mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
vim-patch:7.4.1988
Problem: When updating viminfo with file marks there is no time order.
Solution: Remember the time when a buffer was last used, store marks for
the most recently used buffers.
ab9c89b68d
As this is a viminfo fix, most of this is irrelevant - the patch has
just been brought across for the creation and updating of buffer's
`b_last_used` properties.
This commit is contained in:
@@ -1618,6 +1618,7 @@ void enter_buffer(buf_T *buf)
|
|||||||
if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) {
|
if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) {
|
||||||
(void)did_set_spelllang(curwin);
|
(void)did_set_spelllang(curwin);
|
||||||
}
|
}
|
||||||
|
curbuf->b_last_used = time(NULL);
|
||||||
|
|
||||||
redraw_later(NOT_VALID);
|
redraw_later(NOT_VALID);
|
||||||
}
|
}
|
||||||
|
@@ -543,6 +543,8 @@ struct file_buffer {
|
|||||||
long b_mtime_read; // last change time when reading
|
long b_mtime_read; // last change time when reading
|
||||||
uint64_t b_orig_size; // size of original file in bytes
|
uint64_t b_orig_size; // size of original file in bytes
|
||||||
int b_orig_mode; // mode of original file
|
int b_orig_mode; // mode of original file
|
||||||
|
time_t b_last_used; // time when the buffer was last used; used
|
||||||
|
// for viminfo
|
||||||
|
|
||||||
fmark_T b_namedm[NMARKS]; // current named marks (mark.c)
|
fmark_T b_namedm[NMARKS]; // current named marks (mark.c)
|
||||||
|
|
||||||
|
@@ -2670,6 +2670,8 @@ int do_ecmd(
|
|||||||
msg_scrolled_ign = FALSE;
|
msg_scrolled_ign = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
curbuf->b_last_used = time(NULL);
|
||||||
|
|
||||||
if (command != NULL)
|
if (command != NULL)
|
||||||
do_cmdline(command, NULL, NULL, DOCMD_VERBOSE);
|
do_cmdline(command, NULL, NULL, DOCMD_VERBOSE);
|
||||||
|
|
||||||
|
@@ -1260,6 +1260,8 @@ static void normal_redraw(NormalState *s)
|
|||||||
maketitle();
|
maketitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
curbuf->b_last_used = time(NULL);
|
||||||
|
|
||||||
// Display message after redraw. If an external message is still visible,
|
// Display message after redraw. If an external message is still visible,
|
||||||
// it contains the kept message already.
|
// it contains the kept message already.
|
||||||
if (keep_msg != NULL && !msg_ext_is_visible()) {
|
if (keep_msg != NULL && !msg_ext_is_visible()) {
|
||||||
|
Reference in New Issue
Block a user