Skip to content

Commit d784ed7

Browse files
committed
vim-patch:9.1.1739: Matches may be listed twice with wildmode=longest,list
Problem: Matches may be listed twice with wildmode=longest,list when "longest" doesn't change command line (after 9.1.1737). Solution: Set did_wild_list when trying "list" after "longest" (zeertzjq). closes: vim/vim#18227 vim/vim@a28a2eb
1 parent f2bda1e commit d784ed7

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/nvim/ex_getln.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,9 @@ static int command_line_wildchar_complete(CommandLineState *s)
11951195
nextwild(&s->xpc, WILD_NEXT, options, escape);
11961196
}
11971197
showmatches(&s->xpc, p_wmnu, wim_list_next, wim_noselect_next);
1198+
if (wim_list_next) {
1199+
s->did_wild_list = true;
1200+
}
11981201
}
11991202
}
12001203
} else {

test/functional/ui/popupmenu_spec.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4517,7 +4517,7 @@ describe('builtin popupmenu', function()
45174517

45184518
feed('<esc>')
45194519

4520-
-- Check "list" still works
4520+
-- Check that when "longest" produces no result, "list" works
45214521
command('set wildmode=longest,list')
45224522
feed(':cn<Tab>')
45234523
screen:expect([[
@@ -4530,6 +4530,8 @@ describe('builtin popupmenu', function()
45304530
cnfile cnoremenu |
45314531
:cn^ |
45324532
]])
4533+
feed('<Tab>')
4534+
screen:expect_unchanged()
45334535
feed('s')
45344536
screen:expect([[
45354537
|

test/old/testdir/test_cmdline.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,6 +2900,8 @@ func Test_wildmenu_pum()
29002900
call term_sendkeys(buf, "\<C-U>set wildmode=longest,list\<CR>")
29012901
call term_sendkeys(buf, ":cn\<Tab>")
29022902
call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {})
2903+
call term_sendkeys(buf, "\<Tab>")
2904+
call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {})
29032905
call term_sendkeys(buf, "s")
29042906
call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {})
29052907

0 commit comments

Comments
 (0)