diff options
author | Rob Pilling <robpilling@gmail.com> | 2020-03-22 21:40:12 +0000 |
---|---|---|
committer | Rob Pilling <robpilling@gmail.com> | 2020-04-21 21:40:22 +0100 |
commit | 978a6bcaf2b98b3c89381a3eacf642b4f61db033 (patch) | |
tree | 29f26959683fa1f5b10feed3b086531777d1e9f6 /src/nvim/ex_getln.c | |
parent | 9d59f066cbbe8893559586eee5bfca9378cf6385 (diff) | |
download | rneovim-978a6bcaf2b98b3c89381a3eacf642b4f61db033.tar.gz rneovim-978a6bcaf2b98b3c89381a3eacf642b4f61db033.tar.bz2 rneovim-978a6bcaf2b98b3c89381a3eacf642b4f61db033.zip |
vim-patch:8.1.2225: the "last used" info of a buffer is under used
Problem: The "last used" info of a buffer is under used.
Solution: Add "lastused" to getbufinfo(). List buffers sorted by last-used
field. (Andi Massimino, closes vim/vim#4722)
https://github.com/vim/vim/commit/52410575be50d5c40bbe6380159df48cfc382ceb
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index ecaab76612..d9a63ff6da 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -947,6 +947,10 @@ static int command_line_execute(VimState *state, int key) // - wildcard expansion is only done when the 'wildchar' key is really // typed, not when it comes from a macro if ((s->c == p_wc && !s->gotesc && KeyTyped) || s->c == p_wcm) { + int options = WILD_NO_BEEP; + if (wim_flags[s->wim_index] & WIM_BUFLASTUSED) { + options |= WILD_BUFLASTUSED; + } if (s->xpc.xp_numfiles > 0) { // typed p_wc at least twice // if 'wildmode' contains "list" may still need to list if (s->xpc.xp_numfiles > 1 @@ -960,11 +964,11 @@ static int command_line_execute(VimState *state, int key) } if (wim_flags[s->wim_index] & WIM_LONGEST) { - s->res = nextwild(&s->xpc, WILD_LONGEST, WILD_NO_BEEP, - s->firstc != '@'); + s->res = nextwild(&s->xpc, WILD_LONGEST, options, + s->firstc != '@'); } else if (wim_flags[s->wim_index] & WIM_FULL) { - s->res = nextwild(&s->xpc, WILD_NEXT, WILD_NO_BEEP, - s->firstc != '@'); + s->res = nextwild(&s->xpc, WILD_NEXT, options, + s->firstc != '@'); } else { s->res = OK; // don't insert 'wildchar' now } @@ -975,11 +979,11 @@ static int command_line_execute(VimState *state, int key) // if 'wildmode' first contains "longest", get longest // common part if (wim_flags[0] & WIM_LONGEST) { - s->res = nextwild(&s->xpc, WILD_LONGEST, WILD_NO_BEEP, - s->firstc != '@'); + s->res = nextwild(&s->xpc, WILD_LONGEST, options, + s->firstc != '@'); } else { - s->res = nextwild(&s->xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP, - s->firstc != '@'); + s->res = nextwild(&s->xpc, WILD_EXPAND_KEEP, options, + s->firstc != '@'); } // if interrupted while completing, behave like it failed @@ -1016,11 +1020,11 @@ static int command_line_execute(VimState *state, int key) s->did_wild_list = true; if (wim_flags[s->wim_index] & WIM_LONGEST) { - nextwild(&s->xpc, WILD_LONGEST, WILD_NO_BEEP, - s->firstc != '@'); + nextwild(&s->xpc, WILD_LONGEST, options, + s->firstc != '@'); } else if (wim_flags[s->wim_index] & WIM_FULL) { - nextwild(&s->xpc, WILD_NEXT, WILD_NO_BEEP, - s->firstc != '@'); + nextwild(&s->xpc, WILD_NEXT, options, + s->firstc != '@'); } } else { vim_beep(BO_WILD); |