mirror of
https://github.com/vim/vim.git
synced 2025-10-25 09:04:09 -04:00
patch 9.1.1699: Fuzzy completion disabled for 'findfunc' and customlist
Problem: Fuzzy completion disabled for 'findfunc' and customlist
Solution: Remove those cases from cmdline_fuzzy_completion_supported()
because it is supported (Maxim Kim).
fixes: #18117
closes: #18122
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
b760062897
commit
cadba05329
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_find_1.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_find_1.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@49
|
||||
|~+0#4040ff13&| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @3| +0#0000001#e0e0e08|h+1&&|e|l+0&&@1|o|/|w+1&&|o|r+0&&|l|d| @4| +0#4040ff13#ffffff0@27
|
||||
|~| @3| +0#0000001#ffd7ff255|h+1&&|e|l+0&&@1|o|/|w+1&&|o|n+0&&|d|e|r|f|u|l| | +0#4040ff13#ffffff0@27
|
||||
|:+0#0000000&|f|i|n|d| |h|e|l@1|o|/|w|o|r|l|d> @32
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_find_2.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_find_2.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@49
|
||||
|~+0#4040ff13&| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @3| +0#0000001#e0e0e08|h|e|l@1|o|/|w|o|r|l|d| @4| +0#4040ff13#ffffff0@27
|
||||
|~| @3| +0#0000001#ffd7ff255|h|e|l@1|o|/|w|o|n|d|e|r|f|u|l| | +0#4040ff13#ffffff0@27
|
||||
|:+0#0000000&|f|i|n|d| |h|e|l@1|o|/|w|o|r|l|d> @32
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_list_1.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_list_1.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@49
|
||||
|~+0#4040ff13&| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @4| +0#0000001#e0e0e08|h+1&&|e|l+0&&@1|o|/|w+1&&|o|r+0&&|l|d| @4| +0#4040ff13#ffffff0@26
|
||||
|~| @4| +0#0000001#ffd7ff255|h+1&&|e|l+0&&@1|o|/|w+1&&|o|n+0&&|d|e|r|f|u|l| | +0#4040ff13#ffffff0@26
|
||||
|:+0#0000000&|L|i|s|t|T| |h|e|l@1|o|/|w|o|r|l|d> @31
|
||||
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_list_2.dump
Normal file
10
src/testdir/dumps/Test_wildmenu_pum_hl_match_list_2.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
| +0&#ffffff0@49
|
||||
|~+0#4040ff13&| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @48
|
||||
|~| @4| +0#0000001#e0e0e08|h|e|l@1|o|/|w|o|r|l|d| @4| +0#4040ff13#ffffff0@26
|
||||
|~| @4| +0#0000001#ffd7ff255|h|e|l@1|o|/|w|o|n|d|e|r|f|u|l| | +0#4040ff13#ffffff0@26
|
||||
|:+0#0000000&|L|i|s|t|T| |h|e|l@1|o|/|w|o|r|l|d> @31
|
||||
@@ -3120,6 +3120,62 @@ func Test_wildmenu_pum_hl_match()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Test highlighting of matched text in cmdline completion popup menu provided
|
||||
" by a command completed with customlist.
|
||||
func Test_wildmenu_pum_hl_match_list()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim END
|
||||
set wildoptions=pum,fuzzy
|
||||
hi PmenuMatchSel cterm=reverse
|
||||
hi PmenuMatch cterm=reverse
|
||||
command -nargs=1 -complete=customlist,ListComplete ListT echo <q-args>
|
||||
func ListComplete(A, B, C)
|
||||
return ['hello/world', 'hello/wonderful']->matchfuzzy(a:A)
|
||||
endfunc
|
||||
END
|
||||
call writefile(lines, 'Xwildmenu_pum_hl', 'D')
|
||||
let buf = RunVimInTerminal('-S Xwildmenu_pum_hl', #{rows: 10, cols: 50})
|
||||
|
||||
call term_sendkeys(buf, ":ListT hewo\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_hl_match_list_1', {})
|
||||
call term_sendkeys(buf, "\<Esc>:set wildoptions-=fuzzy\<CR>")
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, ":ListT hewo\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_hl_match_list_2', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Test highlighting of matched text in cmdline completion popup menu provided
|
||||
" by a custom 'findfunc'
|
||||
func Test_wildmenu_pum_hl_match_findfunc()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim END
|
||||
set wildoptions=pum,fuzzy
|
||||
hi PmenuMatchSel cterm=reverse
|
||||
hi PmenuMatch cterm=reverse
|
||||
func FindComplete(cmdarg, cmdcomplete)
|
||||
return ['hello/world', 'hello/wonderful']->matchfuzzy(a:cmdarg)
|
||||
endfunc
|
||||
set findfunc=FindComplete
|
||||
END
|
||||
call writefile(lines, 'Xwildmenu_pum_hl', 'D')
|
||||
let buf = RunVimInTerminal('-S Xwildmenu_pum_hl', #{rows: 10, cols: 50})
|
||||
|
||||
call term_sendkeys(buf, ":find hewo\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_hl_match_find_1', {})
|
||||
call term_sendkeys(buf, "\<Esc>:set wildoptions-=fuzzy\<CR>")
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, ":find hewo\<Tab>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_hl_match_find_2', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Test for completion after a :substitute command followed by a pipe (|)
|
||||
" character
|
||||
func Test_cmdline_complete_substitute()
|
||||
|
||||
Reference in New Issue
Block a user