Mercurial > vim
changeset 9412:80333fcbaddf v7.4.1987
commit https://github.com/vim/vim/commit/dec85cf75044ed94f611c825a7a0b0050a2597b9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 2 22:33:46 2016 +0200
patch 7.4.1987
Problem: When copying unrecognized lines for viminfo, end up with useless
continuation lines.
Solution: Skip continuation lines.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Jul 2016 22:45:05 +0200 |
parents | f3e9d167b0f9 |
children | d72229478e52 |
files | src/ex_cmds.c src/version.c |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2834,13 +2834,23 @@ write_viminfo_barlines(vir_T *virp, FILE { 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 */