diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-06-14 23:02:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-06-14 23:02:46 +0200 |
commit | 36f0f0686ca313ef7b76387378cd5dc7acea1924 (patch) | |
tree | 55f9977975fcee2a56c28b7327b4235c18b7349d /src | |
parent | ab47c61f46f0797308217cd3c045472cb0ec3195 (diff) | |
download | vim-git-36f0f0686ca313ef7b76387378cd5dc7acea1924.tar.gz |
patch 7.4.1938v7.4.1938
Problem: When writing viminfo numbered marks were duplicated.
Solution: Check for duplicates between current numbered marks and the ones
read from viminfo.
Diffstat (limited to 'src')
-rw-r--r-- | src/mark.c | 24 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 22 insertions, 4 deletions
diff --git a/src/mark.c b/src/mark.c index 008a0d0fe..5e2ac5507 100644 --- a/src/mark.c +++ b/src/mark.c @@ -1674,13 +1674,29 @@ write_viminfo_filemarks(FILE *fp) idx = NMARKS; for (i = NMARKS; i < NMARKS + EXTRA_MARKS; i++) { - if (vi_namedfm != NULL - && vi_namedfm[vi_idx].fmark.mark.lnum != 0 - && (vi_namedfm[vi_idx].time_set > namedfm[idx].time_set + xfmark_T *vi_fm = vi_namedfm != NULL ? &vi_namedfm[vi_idx] : NULL; + + if (vi_fm != NULL + && vi_fm->fmark.mark.lnum != 0 + && (vi_fm->time_set > namedfm[idx].time_set || namedfm[idx].fmark.mark.lnum == 0)) - fm = &vi_namedfm[vi_idx++]; + { + fm = vi_fm; + ++vi_idx; + } else + { fm = &namedfm[idx++]; + if (vi_fm != NULL + && vi_fm->fmark.mark.lnum == fm->fmark.mark.lnum + && vi_fm->time_set == fm->time_set + && ((vi_fm->fmark.fnum != 0 + && vi_fm->fmark.fnum == fm->fmark.fnum) + || (vi_fm->fname != NULL + && fm->fname != NULL + && STRCMP(vi_fm->fname, fm->fname) == 0))) + ++vi_idx; /* skip duplicate */ + } write_one_filemark(fp, fm, '\'', i - NMARKS + '0'); } diff --git a/src/version.c b/src/version.c index 2cdd14245..1a2b1f3c2 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1938, +/**/ 1937, /**/ 1936, |