]> granicus.if.org Git - vim/commitdiff
patch 7.4.1987 v7.4.1987
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Jul 2016 20:33:46 +0000 (22:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Jul 2016 20:33:46 +0000 (22:33 +0200)
Problem:    When copying unrecognized lines for viminfo, end up with useless
            continuation lines.
Solution:   Skip continuation lines.

src/ex_cmds.c
src/version.c

index e7b3b2865b41161c43dbb80157e9bf961a048495..72603d1bd2aab90a85894b5a31450e0499e804c5 100644 (file)
@@ -2834,13 +2834,23 @@ write_viminfo_barlines(vir_T *virp, FILE *fp_out)
 {
     int                i;
     garray_T   *gap = &virp->vir_barlines;
+    int                seen_useful = FALSE;
+    char       *line;
 
     if (gap->ga_len > 0)
     {
        fputs(_("\n# Bar lines, copied verbatim:\n"), fp_out);
 
+       /* Skip over continuation lines until seeing a useful line. */
        for (i = 0; i < gap->ga_len; ++i)
-           fputs(((char **)(gap->ga_data))[i], fp_out);
+       {
+           line = ((char **)(gap->ga_data))[i];
+           if (seen_useful || line[1] != '<')
+           {
+               fputs(line, fp_out);
+               seen_useful = TRUE;
+           }
+       }
     }
 }
 #endif /* FEAT_VIMINFO */
index 8a7c8d77402e09d82316aa6b57b35825cb327952..0a720cd1efb6174838a7ae1a66e2d3b0cd8f336c 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1987,
 /**/
     1986,
 /**/