summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-02 22:33:46 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-02 22:33:46 +0200
commitdec85cf75044ed94f611c825a7a0b0050a2597b9 (patch)
treee46802444d0df51308894dc70142df8fc32be86e /src/ex_cmds.c
parentfef524bbff9aa186838c35212b2f89f61d627cf8 (diff)
downloadvim-git-dec85cf75044ed94f611c825a7a0b0050a2597b9.tar.gz
patch 7.4.1987v7.4.1987
Problem: When copying unrecognized lines for viminfo, end up with useless continuation lines. Solution: Skip continuation lines.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e7b3b2865..72603d1bd 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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 */