patch 9.1.1182: No cmdline completion for 'completefuzzycollect' Commit: https://github.com/vim/vim/commit/53d59ecc1d93ce3a3f6d0182479d825852018ceb Author: zeertzjq <zeert...@outlook.com> Date: Fri Mar 7 19:09:09 2025 +0100
patch 9.1.1182: No cmdline completion for 'completefuzzycollect' Problem: No cmdline completion for the 'completefuzzycollect' option (after v9.1.1178) Solution: Add cmdline completion for the 'completefuzzycollect' option, improve its description in optwin.vim (zeertzjq). closes: #16813 Signed-off-by: zeertzjq <zeert...@outlook.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6afe32f1e..588daf643 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Mar 06 +*options.txt* For Vim version 9.1. Last change: 2025 Mar 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2135,10 +2135,10 @@ A jump table for the options with a short description can be found at |Q_op|. fuzzy Enable |fuzzy-matching| for completion candidates. This allows for more flexible and intuitive matching, where characters can be skipped and matches can be found even - if the exact sequence is not typed. Note: This option + if the exact sequence is not typed. Note: This option does not affect the collection of candidate list, it only controls how completion candidates are reduced from the - list of alternatives. If you want to use |fuzzy-matching| + list of alternatives. If you want to use |fuzzy-matching| to gather more alternatives for your candidate list, see |'completefuzzycollect'|. diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 2c28ee1fc..9d8ac7645 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2025 Feb 08 +" Last Change: 2025 Mar 07 " Former Maintainer: Bram Moolenaar <b...@vim.org> " If there already is an option window, jump to that one. @@ -849,7 +849,7 @@ if has("insert_expand") call <SID>AddOption("complete", gettext("specifies how Insert mode completion works for CTRL-N and CTRL-P")) call append("$", " " .. s:local_to_buffer) call <SID>OptionL("cfc") - call <SID>AddOption("completefuzzycollect", gettext("using fuzzy collect for defaule completion mode")) + call <SID>AddOption("completefuzzycollect", gettext("use fuzzy collection for specific completion modes")) call <SID>OptionL("cpt") call <SID>AddOption("completeopt", gettext("whether to use a popup menu for Insert mode completion")) call <SID>OptionL("cot") diff --git a/src/optiondefs.h b/src/optiondefs.h index a8d7972d3..38e871c88 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -656,7 +656,7 @@ static struct vimoption options[] = #endif SCTX_INIT}, {"completefuzzycollect", "cfc", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, - (char_u *)&p_cfc, PV_NONE, did_set_completefuzzycollect, NULL, + (char_u *)&p_cfc, PV_NONE, did_set_completefuzzycollect, expand_set_completefuzzycollect, {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"completeitemalign", "cia", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, diff --git a/src/optionstr.c b/src/optionstr.c index 5b863bcc9..517a8358c 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -1659,6 +1659,20 @@ did_set_completefuzzycollect(optset_T *args UNUSED) return NULL; } + int +expand_set_completefuzzycollect( + optexpand_T *args, + int *numMatches, + char_u ***matches) +{ + return expand_set_opt_string( + args, + p_cfc_values, + ARRAY_LENGTH(p_cfc_values) - 1, + numMatches, + matches); +} + /* * The 'completeitemalign' option is changed. */ diff --git a/src/proto/optionstr.pro b/src/proto/optionstr.pro index 6fd26bab0..c52dbe932 100644 --- a/src/proto/optionstr.pro +++ b/src/proto/optionstr.pro @@ -44,6 +44,7 @@ char *did_set_completeopt(optset_T *args); int expand_set_completeopt(optexpand_T *args, int *numMatches, char_u ***matches); char *did_set_completeitemalign(optset_T *args); char *did_set_completefuzzycollect(optset_T *args); +int expand_set_completefuzzycollect(optexpand_T *args, int *numMatches, char_u ***matches); char *did_set_completepopup(optset_T *args); char *did_set_completeslash(optset_T *args); int expand_set_completeslash(optexpand_T *args, int *numMatches, char_u ***matches); diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 84a0035b9..6a561ac74 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -501,6 +501,7 @@ func Test_set_completion_string_values() endif call assert_equal('.', getcompletion('set complete=', 'cmdline')[1]) call assert_equal('menu', getcompletion('set completeopt=', 'cmdline')[1]) + call assert_equal('keyword', getcompletion('set completefuzzycollect=', 'cmdline')[0]) if exists('+completeslash') call assert_equal('backslash', getcompletion('set completeslash=', 'cmdline')[1]) endif diff --git a/src/version.c b/src/version.c index ad0cbcc73..671ac25ad 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1182, /**/ 1181, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1tqcDx-00EGTb-Qj%40256bit.org.