summaryrefslogtreecommitdiff
path: root/fzf-completion.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2013-11-23 20:37:53 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2013-11-23 20:37:53 +0900
commit9a49a29c7fe7839e7004c4555d55fd4ad2297e6c (patch)
tree6571fb888c3f5d0f49457e959307e098690c48fd /fzf-completion.bash
parent89ae45cda4fbf0b56abe0c568275a98fc5f51231 (diff)
downloadfzf-9a49a29c7fe7839e7004c4555d55fd4ad2297e6c.tar.gz
Fix bash completion (~/abc/def/ghi**)
~/abc/def/ghi** should match ghi under ~/abc/def/, not ~/abc/def*
Diffstat (limited to 'fzf-completion.bash')
-rw-r--r--fzf-completion.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/fzf-completion.bash b/fzf-completion.bash
index 78d7e1d1..c4aca319 100644
--- a/fzf-completion.bash
+++ b/fzf-completion.bash
@@ -45,7 +45,7 @@ _fzf_generic_completion() {
if [ -z "$dir" -o -d "$dir" ]; then
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
- [ "$dir" = '.' ] && dir=''
+ [ "$dir" = './' ] && dir=''
matches=$(find "$dir"* $1 2> /dev/null | fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do
if [[ ${item} =~ \ ]]; then
echo -n "\"$item\" "
@@ -62,6 +62,7 @@ _fzf_generic_completion() {
return 0
fi
dir=$(dirname "$dir")
+ [[ "$dir" =~ /$ ]] || dir="$dir"/
done
fi
}