forked from aniani/vim
patch 9.1.0811: :find expansion does not consider 'findexpr'
Problem: :find expansion does not consider 'findexpr' Solution: Support expanding :find command argument using 'findexpr' (Yegappan Lakshmanan) closes: #15929 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
aeb1c97db5
commit
2f6efaccfd
@@ -2819,7 +2819,7 @@ expand_files_and_dirs(
|
||||
{
|
||||
int free_pat = FALSE;
|
||||
int i;
|
||||
int ret;
|
||||
int ret = FAIL;
|
||||
|
||||
// for ":set path=" and ":set tags=" halve backslashes for escaped
|
||||
// space
|
||||
@@ -2850,19 +2850,28 @@ expand_files_and_dirs(
|
||||
}
|
||||
}
|
||||
|
||||
if (xp->xp_context == EXPAND_FILES)
|
||||
flags |= EW_FILE;
|
||||
else if (xp->xp_context == EXPAND_FILES_IN_PATH)
|
||||
flags |= (EW_FILE | EW_PATH);
|
||||
else if (xp->xp_context == EXPAND_DIRS_IN_CDPATH)
|
||||
flags = (flags | EW_DIR | EW_CDPATH) & ~EW_FILE;
|
||||
if (xp->xp_context == EXPAND_FILES_IN_PATH && *get_findexpr() != NUL)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
ret = expand_findexpr(pat, matches, numMatches);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
flags = (flags | EW_DIR) & ~EW_FILE;
|
||||
if (options & WILD_ICASE)
|
||||
flags |= EW_ICASE;
|
||||
{
|
||||
if (xp->xp_context == EXPAND_FILES)
|
||||
flags |= EW_FILE;
|
||||
else if (xp->xp_context == EXPAND_FILES_IN_PATH)
|
||||
flags |= (EW_FILE | EW_PATH);
|
||||
else if (xp->xp_context == EXPAND_DIRS_IN_CDPATH)
|
||||
flags = (flags | EW_DIR | EW_CDPATH) & ~EW_FILE;
|
||||
else
|
||||
flags = (flags | EW_DIR) & ~EW_FILE;
|
||||
if (options & WILD_ICASE)
|
||||
flags |= EW_ICASE;
|
||||
|
||||
// Expand wildcards, supporting %:h and the like.
|
||||
ret = expand_wildcards_eval(&pat, numMatches, matches, flags);
|
||||
// Expand wildcards, supporting %:h and the like.
|
||||
ret = expand_wildcards_eval(&pat, numMatches, matches, flags);
|
||||
}
|
||||
if (free_pat)
|
||||
vim_free(pat);
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
|
Reference in New Issue
Block a user