0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.1736: viminfo support is spread out

Problem:    Viminfo support is spread out.
Solution:   Move more viminfo code to viminfo.c. (Yegappan Lakshmanan,
            closes #4717)  Reorder code to make most functions static.
This commit is contained in:
Bram Moolenaar
2019-07-23 22:15:25 +02:00
parent c61a48d259
commit c3328169d5
13 changed files with 1794 additions and 1740 deletions

View File

@@ -5085,24 +5085,23 @@ global_exe(char_u *cmd)
}
#ifdef FEAT_VIMINFO
int
read_viminfo_sub_string(vir_T *virp, int force)
/*
* Get the previous substitute pattern.
*/
char_u *
get_old_sub(void)
{
if (force)
vim_free(old_sub);
if (force || old_sub == NULL)
old_sub = viminfo_readstring(virp, 1, TRUE);
return viminfo_readline(virp);
return old_sub;
}
/*
* Set the previous substitute pattern. "val" must be allocated.
*/
void
write_viminfo_sub_string(FILE *fp)
set_old_sub(char_u *val)
{
if (get_viminfo_parameter('/') != 0 && old_sub != NULL)
{
fputs(_("\n# Last Substitute String:\n$"), fp);
viminfo_writestring(fp, old_sub);
}
vim_free(old_sub);
old_sub = val;
}
#endif // FEAT_VIMINFO