diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-28 22:53:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-28 22:53:37 +0200 |
commit | b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8 (patch) | |
tree | 341dc463600cbb27377711dc00ddd0fda5fda44d /src/evalfunc.c | |
parent | 471a8975690af01a1244b28d5b5f978ca623028f (diff) |
patch 7.4.2112v7.4.2112
Problem: getcompletion(.., 'dir') returns a match with trailing "*" when
there are no matches. (Chdiza)
Solution: Return an empty list when there are no matches. Add a trailing
slash to directories. (Yegappan Lakshmanan) Add tests for no
matches. (closes #947)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index ae17038cce..53783af740 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -4164,8 +4164,8 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) { char_u *pat; expand_T xpc; - int options = WILD_KEEP_ALL | WILD_SILENT | WILD_USE_NL - | WILD_LIST_NOTFOUND | WILD_NO_BEEP; + int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH + | WILD_NO_BEEP; if (p_wic) options |= WILD_ICASE; @@ -4194,7 +4194,7 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL)) { - int i; + int i; ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP); |