summaryrefslogtreecommitdiff
path: root/src/mark.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-02 19:20:06 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-02 19:20:06 +0200
commit951fa1819ad0e74d73e885d0ec04dd6c70f8d2f7 (patch)
treee85aca874d65e83fe05b281c31c072643b41ef05 /src/mark.c
parentee2615af64fdcee87d8e4b13b65356e77fbd969b (diff)
downloadvim-951fa1819ad0e74d73e885d0ec04dd6c70f8d2f7.zip
patch 7.4.1982
Problem: Viminfo file contains duplicate change marks. Solution: Drop duplicate marks.
Diffstat (limited to 'src/mark.c')
-rw-r--r--src/mark.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mark.c b/src/mark.c
index 264124f59..2e8fdd63f 100644
--- 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]);