summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-15 16:31:47 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-15 16:31:47 +0200
commitff1806f8da8830ca2a528f2eaa39b3e85489da6d (patch)
treea78d3e494761a3246b5b50ac5830628207c8374e /src/ex_cmds.c
parent141f6bb34124872d8676066e021bf899d4023c23 (diff)
updated for version 7.3.1197v7.3.1197
Problem: ":wviminfo!" does not write history previously read from a viminfo file. (Roland Eggner) Solution: When not merging history write all entries.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index a61bcdd39e..445b66fee5 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1722,11 +1722,11 @@ read_viminfo(file, flags)
}
/*
- * write_viminfo() -- Write the viminfo file. The old one is read in first so
- * that effectively a merge of current info and old info is done. This allows
- * multiple vims to run simultaneously, without losing any marks etc. If
- * forceit is TRUE, then the old file is not read in, and only internal info is
- * written to the file. -- webb
+ * Write the viminfo file. The old one is read in first so that effectively a
+ * merge of current info and old info is done. This allows multiple vims to
+ * run simultaneously, without losing any marks etc.
+ * If "forceit" is TRUE, then the old file is not read in, and only internal
+ * info is written to the file.
*/
void
write_viminfo(file, forceit)
@@ -2047,6 +2047,7 @@ do_viminfo(fp_in, fp_out, flags)
int count = 0;
int eof = FALSE;
vir_T vir;
+ int merge = FALSE;
if ((vir.vir_line = alloc(LSIZE)) == NULL)
return;
@@ -2058,9 +2059,12 @@ do_viminfo(fp_in, fp_out, flags)
if (fp_in != NULL)
{
if (flags & VIF_WANT_INFO)
+ {
eof = read_viminfo_up_to_marks(&vir,
flags & VIF_FORCEIT, fp_out != NULL);
- else
+ merge = TRUE;
+ }
+ else if (flags != 0)
/* Skip info, find start of marks */
while (!(eof = viminfo_readline(&vir))
&& vir.vir_line[0] != '>')
@@ -2079,7 +2083,7 @@ do_viminfo(fp_in, fp_out, flags)
write_viminfo_search_pattern(fp_out);
write_viminfo_sub_string(fp_out);
#ifdef FEAT_CMDHIST
- write_viminfo_history(fp_out);
+ write_viminfo_history(fp_out, merge);
#endif
write_viminfo_registers(fp_out);
#ifdef FEAT_EVAL