diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index a110a116ed..b4ad8af552 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1195,6 +1195,9 @@ static int command_line_wildchar_complete(CommandLineState *s) nextwild(&s->xpc, WILD_NEXT, options, escape); } showmatches(&s->xpc, p_wmnu, wim_list_next, wim_noselect_next); + if (wim_list_next) { + s->did_wild_list = true; + } } } } else { diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index c0bf1421bb..1af9315268 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -4517,7 +4517,7 @@ describe('builtin popupmenu', function() feed('') - -- Check "list" still works + -- Check that when "longest" produces no result, "list" works command('set wildmode=longest,list') feed(':cn') screen:expect([[ @@ -4530,6 +4530,8 @@ describe('builtin popupmenu', function() cnfile cnoremenu | :cn^ | ]]) + feed('') + screen:expect_unchanged() feed('s') screen:expect([[ | diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index e9a719978a..a52e7f8831 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -2900,6 +2900,8 @@ func Test_wildmenu_pum() call term_sendkeys(buf, "\set wildmode=longest,list\") call term_sendkeys(buf, ":cn\") call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {}) + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {}) call term_sendkeys(buf, "s") call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {})