mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +00:00
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: vim/vim#15929
2f6efaccfd
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -2497,21 +2497,25 @@ static int expand_files_and_dirs(expand_T *xp, char *pat, char ***matches, int *
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
int ret = FAIL;
|
||||
if (xp->xp_context == EXPAND_FILES_IN_PATH && *get_findexpr() != NUL) {
|
||||
ret = expand_findexpr(pat, matches, numMatches);
|
||||
} else {
|
||||
flags = (flags | EW_DIR) & ~EW_FILE;
|
||||
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);
|
||||
}
|
||||
if (options & WILD_ICASE) {
|
||||
flags |= EW_ICASE;
|
||||
}
|
||||
|
||||
// Expand wildcards, supporting %:h and the like.
|
||||
int ret = expand_wildcards_eval(&pat, numMatches, matches, flags);
|
||||
if (free_pat) {
|
||||
xfree(pat);
|
||||
}
|
||||
|
Reference in New Issue
Block a user