diff options
Diffstat (limited to 'src/nvim/cmdexpand.c')
-rw-r--r-- | src/nvim/cmdexpand.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 5b7017481e..aeaed536fc 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -109,6 +109,7 @@ static bool cmdline_fuzzy_completion_supported(const expand_T *const xp) && xp->xp_context != EXPAND_FILES && xp->xp_context != EXPAND_FILES_IN_PATH && xp->xp_context != EXPAND_FILETYPE + && xp->xp_context != EXPAND_FINDEXPR && xp->xp_context != EXPAND_HELP && xp->xp_context != EXPAND_KEYMAP && xp->xp_context != EXPAND_LUA @@ -1228,7 +1229,8 @@ char *addstar(char *fname, size_t len, int context) // For help tags the translation is done in find_help_tags(). // For a tag pattern starting with "/" no translation is needed. - if (context == EXPAND_HELP + if (context == EXPAND_FINDEXPR + || context == EXPAND_HELP || context == EXPAND_COLORS || context == EXPAND_COMPILER || context == EXPAND_OWNSYNTAX @@ -1827,7 +1829,7 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa case CMD_sfind: case CMD_tabfind: if (xp->xp_context == EXPAND_FILES) { - xp->xp_context = EXPAND_FILES_IN_PATH; + xp->xp_context = *get_findexpr() != NUL ? EXPAND_FINDEXPR : EXPAND_FILES_IN_PATH; } break; case CMD_cd: @@ -2498,7 +2500,7 @@ static int expand_files_and_dirs(expand_T *xp, char *pat, char ***matches, int * } int ret = FAIL; - if (xp->xp_context == EXPAND_FILES_IN_PATH && *get_findexpr() != NUL) { + if (xp->xp_context == EXPAND_FINDEXPR) { ret = expand_findexpr(pat, matches, numMatches); } else { if (xp->xp_context == EXPAND_FILES) { @@ -2720,6 +2722,7 @@ static int ExpandFromContext(expand_T *xp, char *pat, char ***matches, int *numM if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_DIRECTORIES || xp->xp_context == EXPAND_FILES_IN_PATH + || xp->xp_context == EXPAND_FINDEXPR || xp->xp_context == EXPAND_DIRS_IN_CDPATH) { return expand_files_and_dirs(xp, pat, matches, numMatches, flags, options); } |