changeset 9401:160cb082819e v7.4.1982

commit https://github.com/vim/vim/commit/951fa1819ad0e74d73e885d0ec04dd6c70f8d2f7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 2 19:20:06 2016 +0200 patch 7.4.1982 Problem: Viminfo file contains duplicate change marks. Solution: Drop duplicate marks.
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Jul 2016 19:30:05 +0200
parents 1ba77f62adc7
children 165d9b2513e9
files src/mark.c src/version.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mark.c
+++ b/src/mark.c
@@ -1859,7 +1859,12 @@ write_viminfo_marks(FILE *fp_out)
 #ifdef FEAT_JUMPLIST
 		/* changelist positions are stored oldest first */
 		for (i = 0; i < buf->b_changelistlen; ++i)
-		    write_one_mark(fp_out, '+', &buf->b_changelist[i]);
+		{
+		    /* skip duplicates */
+		    if (i == 0 || !equalpos(buf->b_changelist[i - 1],
+							buf->b_changelist[i]))
+			write_one_mark(fp_out, '+', &buf->b_changelist[i]);
+		}
 #endif
 		for (i = 0; i < NMARKS; i++)
 		    write_one_mark(fp_out, 'a' + i, &buf->b_namedm[i]);
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1982,
+/**/
     1981,
 /**/
     1980,