diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-10-01 19:54:59 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-10-01 20:07:27 +0900 |
commit | db324879d2956a2527851102183723df63039904 (patch) | |
tree | 68f27a7a557325130508ed2b1f8c277b20d218d6 /src/nvim/eval.c | |
parent | de802fd4d22e813713bbd6825bfd75c5287a50b4 (diff) | |
download | rneovim-db324879d2956a2527851102183723df63039904.tar.gz rneovim-db324879d2956a2527851102183723df63039904.tar.bz2 rneovim-db324879d2956a2527851102183723df63039904.zip |
vim-patch:7.4.2205
Problem: 'wildignore' always applies to getcompletion().
Solution: Add an option to use 'wildignore' or not. (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
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); |