patch 9.1.1178: not possible to generate completion candidates using fuzzy matching
Problem: not possible to generate completion candidates using fuzzy
matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
modes (glepnir)
fixes #15296
fixes #15295
fixes #15294
closes: #16032
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/optionstr.c b/src/optionstr.c
index e2970b6..5b863bc 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -120,6 +120,7 @@
NULL};
static char *(p_fcl_values[]) = {"all", NULL};
#endif
+static char *(p_cfc_values[]) = {"keyword", "files", "whole_line", NULL};
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", "preinsert", NULL};
#ifdef BACKSLASH_IN_FILENAME
static char *(p_csl_values[]) = {"slash", "backslash", NULL};
@@ -146,6 +147,7 @@
(void)opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE);
(void)opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE);
(void)opt_strings_flags(p_bo, p_bo_values, &bo_flags, TRUE);
+ (void)opt_strings_flags(p_cfc, p_cfc_values, &cfc_flags, TRUE);
(void)opt_strings_flags(p_cot, p_cot_values, &cot_flags, TRUE);
#ifdef FEAT_SESSION
(void)opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE);
@@ -1647,6 +1649,17 @@
}
/*
+ * The 'completefuzzycollect' option is changed.
+ */
+ char *
+did_set_completefuzzycollect(optset_T *args UNUSED)
+{
+ if (opt_strings_flags(p_cfc, p_cfc_values, &cfc_flags, TRUE) != OK)
+ return e_invalid_argument;
+ return NULL;
+}
+
+/*
* The 'completeitemalign' option is changed.
*/
char *