m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 15:53:39 -05:00

[zsh-completion] Fix ~USERNAME** (#230)

This commit is contained in:
Junegunn Choi
2015-05-10 02:35:00 +09:00
parent dc64568c83
commit 26a141c6a6
2 changed files with 16 additions and 3 deletions

View File

@@ -26,7 +26,8 @@ _fzf_path_completion() {
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
[ "$dir" = './' ] && dir=''
matches=$(\find -L ${~dir}* ${=find_opts} 2> /dev/null | ${=fzf} ${=FZF_COMPLETION_OPTS} ${=fzf_opts} -q "$leftover" | while read item; do
dir=${~dir}
matches=$(\find -L $dir* ${=find_opts} 2> /dev/null | ${=fzf} ${=FZF_COMPLETION_OPTS} ${=fzf_opts} -q "$leftover" | while read item; do
printf "%q$suffix " "$item"
done)
matches=${matches% }
@@ -37,7 +38,7 @@ _fzf_path_completion() {
return
fi
dir=$(dirname "$dir")
[[ "$dir" =~ /$ ]] || dir="$dir"/
dir=${dir%/}/
done
}