diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 82a6c12551..7689ea1a27 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -9648,13 +9648,23 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *pat; expand_T xpc; + bool filtered = false; int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH | WILD_NO_BEEP; + if (argvars[2].v_type != VAR_UNKNOWN) { + filtered = get_tv_number_chk(&argvars[2], NULL); + } + if (p_wic) { options |= WILD_ICASE; } + // For filtered results, 'wildignore' is used + if (!filtered) { + options |= WILD_KEEP_ALL; + } + ExpandInit(&xpc); xpc.xp_pattern = get_tv_string(&argvars[0]); xpc.xp_pattern_len = STRLEN(xpc.xp_pattern); |