mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
shada: Always use merging when reading jumps and changes
This commit is contained in:
@@ -1359,19 +1359,6 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
|
||||
shada_free_shada_entry(&cur_entry);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (force) {
|
||||
if (curwin->w_jumplistlen == JUMPLISTSIZE) {
|
||||
// Jump list items are ignored in this case.
|
||||
free_xfmark(fm);
|
||||
} else {
|
||||
memmove(&curwin->w_jumplist[1], &curwin->w_jumplist[0],
|
||||
sizeof(curwin->w_jumplist[0])
|
||||
* (size_t) curwin->w_jumplistlen);
|
||||
curwin->w_jumplistidx++;
|
||||
curwin->w_jumplistlen++;
|
||||
curwin->w_jumplist[0] = fm;
|
||||
}
|
||||
} else {
|
||||
const int jl_len = curwin->w_jumplistlen;
|
||||
int i;
|
||||
@@ -1422,7 +1409,6 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
|
||||
shada_free_shada_entry(&cur_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Do not free shada entry: its allocated memory was saved above.
|
||||
break;
|
||||
}
|
||||
@@ -1488,16 +1474,6 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
|
||||
} else {
|
||||
int kh_ret;
|
||||
(void) kh_put(bufset, &cl_bufs, (uintptr_t) buf, &kh_ret);
|
||||
if (force) {
|
||||
if (buf->b_changelistlen == JUMPLISTSIZE) {
|
||||
free_fmark(buf->b_changelist[0]);
|
||||
memmove(buf->b_changelist, buf->b_changelist + 1,
|
||||
sizeof(buf->b_changelist[0]) * (JUMPLISTSIZE - 1));
|
||||
} else {
|
||||
buf->b_changelistlen++;
|
||||
}
|
||||
buf->b_changelist[buf->b_changelistlen - 1] = fm;
|
||||
} else {
|
||||
const int cl_len = buf->b_changelistlen;
|
||||
int i;
|
||||
for (i = cl_len; i > 0; i--) {
|
||||
@@ -1538,7 +1514,6 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
|
||||
cur_entry.data.filemark.fname = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Do not free shada entry: except for fname, its allocated memory (i.e.
|
||||
// additional_data attribute contents if non-NULL) was saved above.
|
||||
xfree(cur_entry.data.filemark.fname);
|
||||
|
Reference in New Issue
Block a user