Commit: patch 9.1.1699: Fuzzy completion disabled for 'findfunc' and customlist

1 view
Skip to first unread message

Christian Brabandt

unread,
Aug 27, 2025, 12:15:20 PM (11 days ago) Aug 27
to vim...@googlegroups.com
patch 9.1.1699: Fuzzy completion disabled for 'findfunc' and customlist

Commit: https://github.com/vim/vim/commit/cadba053293a7294d69b2336dbea50a77b3ee206
Author: Maxim Kim <hab...@gmail.com>
Date: Wed Aug 27 18:09:14 2025 +0200

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 <hab...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index f4feec94b..8b42d7ab1 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -58,7 +58,6 @@ cmdline_fuzzy_completion_supported(expand_T *xp)
case EXPAND_FILES_IN_PATH:
case EXPAND_FILETYPE:
case EXPAND_FILETYPECMD:
- case EXPAND_FINDFUNC:
case EXPAND_HELP:
case EXPAND_KEYMAP:
case EXPAND_OLD_SETTING:
@@ -71,7 +70,6 @@ cmdline_fuzzy_completion_supported(expand_T *xp)
case EXPAND_SHELLCMDLINE:
case EXPAND_TAGS:
case EXPAND_TAGS_LISTFILES:
- case EXPAND_USER_LIST:
return FALSE;

default:
diff --git a/src/testdir/dumps/Test_wildmenu_pum_hl_match_find_1.dump b/src/testdir/dumps/Test_wildmenu_pum_hl_match_find_1.dump
new file mode 100644
index 000000000..8d8bdb27c
--- /dev/null
+++ b/src/testdir/dumps/Test_wildmenu_pum_hl_match_find_1.dump
@@ -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
diff --git a/src/testdir/dumps/Test_wildmenu_pum_hl_match_find_2.dump b/src/testdir/dumps/Test_wildmenu_pum_hl_match_find_2.dump
new file mode 100644
index 000000000..ecbc06ddd
--- /dev/null
+++ b/src/testdir/dumps/Test_wildmenu_pum_hl_match_find_2.dump
@@ -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
diff --git a/src/testdir/dumps/Test_wildmenu_pum_hl_match_list_1.dump b/src/testdir/dumps/Test_wildmenu_pum_hl_match_list_1.dump
new file mode 100644
index 000000000..ce9948d23
--- /dev/null
+++ b/src/testdir/dumps/Test_wildmenu_pum_hl_match_list_1.dump
@@ -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
diff --git a/src/testdir/dumps/Test_wildmenu_pum_hl_match_list_2.dump b/src/testdir/dumps/Test_wildmenu_pum_hl_match_list_2.dump
new file mode 100644
index 000000000..0f26c5a45
--- /dev/null
+++ b/src/testdir/dumps/Test_wildmenu_pum_hl_match_list_2.dump
@@ -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
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 01198e4bc..d09faed79 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -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()
diff --git a/src/version.c b/src/version.c
index 9d0d4e83a..0bcd55691 100644
--- a/src/version.c
+++ b/src/version.c
@@ -724,6 +724,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1699,
/**/
1698,
/**/
Reply all
Reply to author
Forward
0 new messages