summaryrefslogtreecommitdiff
path: root/etc/completions
diff options
context:
space:
mode:
Diffstat (limited to 'etc/completions')
-rw-r--r--etc/completions/__git_files9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/completions/__git_files b/etc/completions/__git_files
index 808fe8e..dd2040d 100644
--- a/etc/completions/__git_files
+++ b/etc/completions/__git_files
@@ -18,7 +18,7 @@ if [[ -z $gitdir ]] {
}
if [[ ! -d .git ]] {
- dirdiff=${PWD#${gitdir%/.git}}
+ dirdiff=${PWD#${gitdir%/.git}/}
for ((i = 1; i <= $#files; i++)) {
prefix=''
item=(${(s:/:)files[$i]})
@@ -30,7 +30,12 @@ if [[ ! -d .git ]] {
prefix+='../'
}
}
- files[$i]=${prefix}${(j:/:)item}
+ files[$i]=${prefix}
+ for j in $item; {
+ [[ -n $j ]] && files[$i]+="$j/"
+ }
+ files[$i]=${files[$i]%/}
+ echo $files[$i] >> /tmp/bar
}
}
_wanted files expl 'index file' _multi_parts $@ - / files