From 2bed7d370e3ff654542aec0e9ad698dac64f244b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 19 Sep 2023 13:39:57 +0900 Subject: [shell] Use --scheme=path when appropriate Without the option, you may get suboptimal results if you have many paths with spaces in their names. e.g. https://github.com/junegunn/fzf/issues/2909#issuecomment-1207690770 Close #3433 --- shell/completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell/completion.bash') diff --git a/shell/completion.bash b/shell/completion.bash index c1a319b9..a34e327f 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -182,7 +182,7 @@ __fzf_generic_path_completion() { leftover=${leftover/#\/} [[ -z "$dir" ]] && dir='.' [[ "$dir" != "/" ]] && dir="${dir/%\//}" - matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $2" __fzf_comprun "$4" -q "$leftover" | while read -r item; do + matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --scheme=path --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $2" __fzf_comprun "$4" -q "$leftover" | while read -r item; do printf "%q " "${item%$3}$3" done) matches=${matches% } -- cgit v1.2.3