From 756513f9c9748df1df2fa88e1a6ab7e756338cdc Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Sat, 29 May 2021 00:51:05 +0800 Subject: [PATCH] [Search directory] fix specifying base directories using quotes (#163) To reproduce the bug, create a folder titled 'with space/' and trigger directory search. It won't scope the search to the folder. --- functions/__fzf_search_current_dir.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/__fzf_search_current_dir.fish b/functions/__fzf_search_current_dir.fish index 50c05f3e..2ccf7561 100644 --- a/functions/__fzf_search_current_dir.fish +++ b/functions/__fzf_search_current_dir.fish @@ -13,7 +13,7 @@ function __fzf_search_current_dir --description "Search the current directory. R # If the current token is a directory and has a trailing slash, # then use it as fd's base directory. - if string match --quiet -- "*/" $token && test -d "$unescaped_exp_token" + if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token" set --append fd_opts --base-directory=$unescaped_exp_token # use the directory name as fzf's prompt to indicate the search is limited to that directory set --prepend fzf_arguments --prompt="$unescaped_exp_token" --preview="__fzf_preview_file $expanded_token{}"