summaryrefslogtreecommitdiff
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-03-22 16:06:31 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-22 16:06:31 +0000
commite7dd0fa2c61fe71f12c72b0dcb7bb6415eb048fb (patch)
tree5f9d0bb515c76a3bd9b3939b59fa10f024e2faa5 /src/cmdexpand.c
parent35dc17634dd6da5b90bd1b0160c4ed9e394f4b87 (diff)
downloadvim-git-e7dd0fa2c61fe71f12c72b0dcb7bb6415eb048fb.tar.gz
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"v8.2.4608
Problem: getcompletion() does not work properly when 'wildoptions contains "fuzzy". Solution: Do not use addstar(). (Yegappan Lakshmanan, closes #9992, closes #9986)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 5ba6b084d..defc282db 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -3707,7 +3707,12 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
# endif
}
- pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
+ if (cmdline_fuzzy_completion_supported(&xpc))
+ // when fuzzy matching, don't modify the search string
+ pat = vim_strsave(xpc.xp_pattern);
+ else
+ pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
+
if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL))
{
int i;