mirror of
https://github.com/vim/vim.git
synced 2025-10-23 08:44:20 -04:00
patch 9.1.1714: completion: wildmode=longest:full selects wrong item
Problem: completion: wildmode=longest:full selects wrong item
(zeertzjq)
Solution: Fix issue, refactor ex_getln.c slightly
(Girish Palya)
fixes: #18102
closes: #18125
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
5355e81868
commit
2eccb4d0be
@@ -1,10 +1,10 @@
|
||||
|~+0#4040ff13#ffffff0| @73
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|:+0#0000000&|c|n| @71
|
||||
|c|n|e|w|e|r| @6|c|n|f|i|l|e| @6|c|n|o|r|e|m|a|p| @40
|
||||
|c|n|e|x|t| @7|c|n|o|r|e|a|b@1|r|e|v| @1|c|n|o|r|e|m|e|n|u| @39
|
||||
|:|c|n> @71
|
||||
|~| @73
|
||||
|~| @73
|
||||
|:+0#0000000&|c|n> @71
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
|:+0#0000000&|c|n| @71
|
||||
|c|n|e|w|e|r| @6|c|n|f|i|l|e| @6|c|n|o|r|e|m|a|p| @40
|
||||
|c|n|e|x|t| @7|c|n|o|r|e|a|b@1|r|e|v| @1|c|n|o|r|e|m|e|n|u| @39
|
||||
|:|c|n|s> @70
|
||||
|:|c|n> @71
|
||||
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_54.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_54.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|c+0#0000001#ffff4012|n|e|w|e|r| +3#0000000#ffffff0@1|c|n|e|x|t| @1|c|n|f|i|l|e| @1|c|n|o|r|e|a|b@1|r|e|v| @1|c|n|o|r|e|m|a|p| @1|c|n|o|r|e|m|e|n|u| @19
|
||||
|:+0&&|c|n|e|w|e|r> @67
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_55.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_55.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
|~+0#4040ff13#ffffff0| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|:+0#0000000&|c|n| @71
|
||||
|c|n|e|w|e|r| @6|c|n|f|i|l|e| @6|c|n|o|r|e|m|a|p| @40
|
||||
|c|n|e|x|t| @7|c|n|o|r|e|a|b@1|r|e|v| @1|c|n|o|r|e|m|e|n|u| @39
|
||||
|:|c|n> @71
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_56.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_56.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
|~+0#4040ff13#ffffff0| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|:+0#0000000&|c|n| @71
|
||||
|c|n|e|w|e|r| @6|c|n|f|i|l|e| @6|c|n|o|r|e|m|a|p| @40
|
||||
|c|n|e|x|t| @7|c|n|o|r|e|a|b@1|r|e|v| @1|c|n|o|r|e|m|e|n|u| @39
|
||||
|c+0#0000001#ffff4012|n|e|w|e|r| +3#0000000#ffffff0@1|c|n|e|x|t| @1|c|n|f|i|l|e| @1|c|n|o|r|e|a|b@1|r|e|v| @1|c|n|o|r|e|m|a|p| @1|c|n|o|r|e|m|e|n|u| @19
|
||||
|:+0&&|c|n|e|w|e|r> @67
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_57.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_57.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|:+0#0000000&|s|i|g|n| |u|n> @66
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_58.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_58.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|u+0#0000001#ffff4012|n|d|e|f|i|n|e| +3#0000000#ffffff0@1|u|n|p|l|a|c|e| @57
|
||||
|:+0&&|s|i|g|n| |u|n|d|e|f|i|n|e> @60
|
||||
@@ -2825,11 +2825,11 @@ func Test_wildmenu_pum()
|
||||
call term_sendkeys(buf, "sign xyz\<Esc>:sign \<Tab>\<C-E>\<Up>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_29', {})
|
||||
|
||||
" Check "list" still works
|
||||
" Check that when "longest" produces no result, "list" works
|
||||
call term_sendkeys(buf, "\<C-U>set wildmode=longest,list\<CR>")
|
||||
call term_sendkeys(buf, ":cn\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {})
|
||||
call term_sendkeys(buf, "s")
|
||||
call term_sendkeys(buf, "\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {})
|
||||
|
||||
" Tests a directory name contained full-width characters.
|
||||
@@ -2929,7 +2929,32 @@ func Test_wildmenu_pum()
|
||||
call term_sendkeys(buf, "\<Esc>:set wildchazz\<Left>\<Left>\<Tab>\<C-Y>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_53', {})
|
||||
|
||||
call term_sendkeys(buf, "\<C-U>\<CR>")
|
||||
call term_sendkeys(buf, "\<Esc>:set showtabline& laststatus& lazyredraw&\<CR>")
|
||||
|
||||
" Verify that if "longest" finds nothing, wildmenu is still shown
|
||||
call term_sendkeys(buf, ":set wildmode=longest:full,full wildoptions&\<CR>")
|
||||
call term_sendkeys(buf, ":cn\<Tab>")
|
||||
call TermWait(buf, 50)
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_54', {})
|
||||
|
||||
" Verify that if "longest" finds nothing, "list" is still shown
|
||||
call term_sendkeys(buf, "\<Esc>:set wildmode=longest:list,full\<CR>")
|
||||
call term_sendkeys(buf, ":cn\<Tab>")
|
||||
call TermWait(buf, 50)
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_55', {})
|
||||
call term_sendkeys(buf, "\<Tab>")
|
||||
call TermWait(buf, 50)
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_56', {})
|
||||
|
||||
" Verify that if "longest" finds a candidate, wildmenu is not shown
|
||||
call term_sendkeys(buf, "\<Esc>:set wildmode=longest:full,full wildoptions&\<CR>")
|
||||
call term_sendkeys(buf, ":sign u\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_57', {})
|
||||
" Subsequent wildchar shows wildmenu
|
||||
call term_sendkeys(buf, "\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_58', {})
|
||||
|
||||
call term_sendkeys(buf, "\<C-U>\<Esc>")
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -5507,7 +5507,7 @@ func Test_completetimeout_autocompletetimeout()
|
||||
set completetimeout=1
|
||||
call feedkeys("Gof\<C-N>\<F2>\<Esc>0", 'xt!')
|
||||
let match_count = len(b:matches->mapnew('v:val.word'))
|
||||
call assert_true(match_count < 2000)
|
||||
call assert_true(match_count < 4000)
|
||||
|
||||
set completetimeout=1000
|
||||
call feedkeys("\<Esc>Sf\<C-N>\<F2>\<Esc>0", 'xt!')
|
||||
|
||||
Reference in New Issue
Block a user