mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-09 09:50:26 +00:00
Fix bash completion (~/abc/def/ghi**)
~/abc/def/ghi** should match ghi under ~/abc/def/, not ~/abc/def*
This commit is contained in:
parent
89ae45cda4
commit
9a49a29c7f
@ -45,7 +45,7 @@ _fzf_generic_completion() {
|
|||||||
if [ -z "$dir" -o -d "$dir" ]; then
|
if [ -z "$dir" -o -d "$dir" ]; then
|
||||||
leftover=${base/#"$dir"}
|
leftover=${base/#"$dir"}
|
||||||
leftover=${leftover/#\/}
|
leftover=${leftover/#\/}
|
||||||
[ "$dir" = '.' ] && dir=''
|
[ "$dir" = './' ] && dir=''
|
||||||
matches=$(find "$dir"* $1 2> /dev/null | fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do
|
matches=$(find "$dir"* $1 2> /dev/null | fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do
|
||||||
if [[ ${item} =~ \ ]]; then
|
if [[ ${item} =~ \ ]]; then
|
||||||
echo -n "\"$item\" "
|
echo -n "\"$item\" "
|
||||||
@ -62,6 +62,7 @@ _fzf_generic_completion() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
dir=$(dirname "$dir")
|
dir=$(dirname "$dir")
|
||||||
|
[[ "$dir" =~ /$ ]] || dir="$dir"/
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user