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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/optiondefs.h b/src/optiondefs.h
index a8d7972..38e871c 100644
--- a/src/optiondefs.h
+++ b/src/optiondefs.h
@@ -656,7 +656,7 @@
#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 5b863bc..517a835 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -1659,6 +1659,20 @@
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 6fd26ba..c52dbe9 100644
--- a/src/proto/optionstr.pro
+++ b/src/proto/optionstr.pro
@@ -44,6 +44,7 @@
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 84a0035..6a561ac 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -501,6 +501,7 @@
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 ad0cbcc..671ac25 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1182,
+/**/
1181,
/**/
1180,