aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c28
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);