1
0
forked from aniani/vim

patch 8.1.1727: code for viminfo support is spread out

Problem:    Code for viminfo support is spread out.
Solution:   Move to code to viminfo.c. (Yegappan Lakshmanan, closes #4686)
This commit is contained in:
Bram Moolenaar
2019-07-21 19:25:37 +02:00
parent ed997adaa1
commit defa067c54
19 changed files with 1481 additions and 1452 deletions

View File

@@ -318,9 +318,7 @@ static int did_lcd; /* whether ":lcd" was produced for a session */
#ifndef FEAT_EVAL
# define ex_compiler ex_ni
#endif
#ifdef FEAT_VIMINFO
static void ex_viminfo(exarg_T *eap);
#else
#ifndef FEAT_VIMINFO
# define ex_viminfo ex_ni
#endif
static void ex_behave(exarg_T *eap);
@@ -10713,31 +10711,6 @@ put_line(FILE *fd, char *s)
return OK;
}
#ifdef FEAT_VIMINFO
/*
* ":rviminfo" and ":wviminfo".
*/
static void
ex_viminfo(
exarg_T *eap)
{
char_u *save_viminfo;
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;
}
#endif
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
/*
* Make a dialog message in "buff[DIALOG_MSG_SIZE]".