diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-10-16 01:54:07 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-10-16 01:54:07 -0400 |
commit | 3a970e57dfd48f090f8ccc21567b7974e13d4c68 (patch) | |
tree | 5aeaf1cd7a85c17b29276eee88e9881f56ea134c /src/nvim/ex_docmd.c | |
parent | a3f048ee06dea15490d7b874d295c3fc850cdc51 (diff) | |
parent | db6cba7d5759e02379005702c7a9d760137f4389 (diff) | |
download | rneovim-3a970e57dfd48f090f8ccc21567b7974e13d4c68.tar.gz rneovim-3a970e57dfd48f090f8ccc21567b7974e13d4c68.tar.bz2 rneovim-3a970e57dfd48f090f8ccc21567b7974e13d4c68.zip |
Merge pull request #2506 from ZyX-I/shada
Replace viminfo with ShaDa files
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f7162896ff..a9262ca6ea 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -75,6 +75,7 @@ #include "nvim/mouse.h" #include "nvim/event/rstream.h" #include "nvim/event/wstream.h" +#include "nvim/shada.h" static int quitmore = 0; static int ex_pressedreturn = FALSE; @@ -9139,22 +9140,21 @@ int put_line(FILE *fd, char *s) } /* - * ":rviminfo" and ":wviminfo". + * ":rshada" and ":wshada". */ -static void ex_viminfo(exarg_T *eap) +static void ex_shada(exarg_T *eap) { - char_u *save_viminfo; + char_u *save_shada; - save_viminfo = p_viminfo; - if (*p_viminfo == NUL) - p_viminfo = (char_u *)"'100"; - if (eap->cmdidx == CMD_rviminfo) { - if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS - | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL) - EMSG(_("E195: Cannot open viminfo file for reading")); - } else - write_viminfo(eap->arg, eap->forceit); - p_viminfo = save_viminfo; + save_shada = p_shada; + if (*p_shada == NUL) + p_shada = (char_u *)"'100"; + if (eap->cmdidx == CMD_rviminfo || eap->cmdidx == CMD_rshada) { + (void) shada_read_everything((char *) eap->arg, eap->forceit, false); + } else { + shada_write_file((char *) eap->arg, eap->forceit); + } + p_shada = save_shada; } /* |