summaryrefslogtreecommitdiff
path: root/shell/completion.zsh
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.zsh
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.zsh')
-rw-r--r--shell/completion.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh
index 1b9d5594..ec2dfdef 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -145,7 +145,7 @@ __fzf_generic_path_completion() {
leftover=${leftover/#\/}
[ -z "$dir" ] && dir='.'
[ "$dir" != "/" ] && dir="${dir/%\//}"
- matches=$(eval "$compgen $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-}" __fzf_comprun "$cmd" ${(Q)${(Z+n+)fzf_opts}} -q "$leftover" | while read item; do
+ matches=$(eval "$compgen $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --scheme=path --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-}" __fzf_comprun "$cmd" ${(Q)${(Z+n+)fzf_opts}} -q "$leftover" | while read item; do
item="${item%$suffix}$suffix"
echo -n "${(q)item} "
done)