]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1182: No cmdline completion for 'completefuzzycollect' v9.1.1182
authorzeertzjq <zeertzjq@outlook.com>
Fri, 7 Mar 2025 18:09:09 +0000 (19:09 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 7 Mar 2025 18:09:09 +0000 (19:09 +0100)
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/options.txt
runtime/optwin.vim
src/optiondefs.h
src/optionstr.c
src/proto/optionstr.pro
src/testdir/test_options.vim
src/version.c

index 6afe32f1ee54fe933cd81d7bbaa8c38ceae98b0a..588daf643627c718bb5fcaf80862e8e9e8da9615 100644 (file)
@@ -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'|.
 
index 2c28ee1fc11979f5cdfd5319ffc75d6f3fe95a30..9d8ac7645571416a0c121b773a56109caa630609 100644 (file)
@@ -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 <Bram@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("$", "\t" .. 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")
index a8d7972d39f096871beb2e2685603cf3286c452a..38e871c88965dd90c48a913830f1c322eabcbe49 100644 (file)
@@ -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,
index 5b863bcc9f79c01c0312210b7c38e9c9f961d564..517a8358c0d942db0e461afec1e8127a02fc6a8b 100644 (file)
@@ -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.
  */
index 6fd26bab0f69c63836a50c85917444625ce0d568..c52dbe932cedf66047bca679a35c0c31a025532e 100644 (file)
@@ -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);
index 84a0035b9a48c6cbab158c97ef1cef19469fee38..6a561ac74dba5257d7017a414cd15fa94d94a224 100644 (file)
@@ -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
index ad0cbcc73f3f2aed42d576f9348bed34d792c91c..671ac25ad7a743c387b4b19674e9c1192c3d42f3 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1182,
 /**/
     1181,
 /**/