0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 7.4.1938

Problem:    When writing viminfo numbered marks were duplicated.
Solution:   Check for duplicates between current numbered marks and the ones
            read from viminfo.
This commit is contained in:
Bram Moolenaar
2016-06-14 23:02:46 +02:00
parent ab47c61f46
commit 36f0f0686c
2 changed files with 22 additions and 4 deletions

View File

@@ -1674,13 +1674,29 @@ write_viminfo_filemarks(FILE *fp)
idx = NMARKS; idx = NMARKS;
for (i = NMARKS; i < NMARKS + EXTRA_MARKS; i++) for (i = NMARKS; i < NMARKS + EXTRA_MARKS; i++)
{ {
if (vi_namedfm != NULL xfmark_T *vi_fm = vi_namedfm != NULL ? &vi_namedfm[vi_idx] : NULL;
&& vi_namedfm[vi_idx].fmark.mark.lnum != 0
&& (vi_namedfm[vi_idx].time_set > namedfm[idx].time_set if (vi_fm != NULL
&& vi_fm->fmark.mark.lnum != 0
&& (vi_fm->time_set > namedfm[idx].time_set
|| namedfm[idx].fmark.mark.lnum == 0)) || namedfm[idx].fmark.mark.lnum == 0))
fm = &vi_namedfm[vi_idx++]; {
fm = vi_fm;
++vi_idx;
}
else else
{
fm = &namedfm[idx++]; 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'); write_one_filemark(fp, fm, '\'', i - NMARKS + '0');
} }

View File

@@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1938,
/**/ /**/
1937, 1937,
/**/ /**/