summaryrefslogtreecommitdiff
path: root/shell/completion.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-09-19 13:39:57 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-09-19 13:39:57 +0900
commit2bed7d370e3ff654542aec0e9ad698dac64f244b (patch)
treef70edbc2bb682f92764f5b12484d93b4816bcac1 /shell/completion.bash
parentd2b852f7cbd2da53804de00cf22ca0b7e6c9f472 (diff)
downloadfzf-2bed7d370e3ff654542aec0e9ad698dac64f244b.tar.gz
[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
Diffstat (limited to 'shell/completion.bash')
-rw-r--r--shell/completion.bash2
1 files changed, 1 insertions, 1 deletions
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% }