summaryrefslogtreecommitdiff
path: root/Completion/Base/Completer/_expand
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Completer/_expand')
-rw-r--r--Completion/Base/Completer/_expand11
1 files changed, 6 insertions, 5 deletions
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index def522a76..e5e4f9b39 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -11,7 +11,7 @@ setopt localoptions nonomatch
[[ _matcher_num -gt 1 ]] && return 1
-local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre
+local exp word sort expr expl subd pref suf=" " force opt asp tmp opre pre epre
local continue=0
(( $# )) &&
@@ -105,7 +105,7 @@ subd=("$exp[@]")
# We need to come out of this with consistent quoting, by hook or by crook.
integer done_quote
-local orig_exp=$exp
+local -a orig_exp=( $exp )
if [[ "$force" = *g* ]] || zstyle -T ":completion:${curcontext}:" glob; then
eval 'exp=( ${~exp//(#b)\\([ \"'"\'"'
])/$match[1]} ); exp=( ${(q)exp} )' 2>/dev/null && (( $#exp )) && done_quote=1
@@ -214,9 +214,10 @@ else
normal=( "$normal[@]" "$i" )
fi
done
- (( $#dir )) && compadd "$expl[@]" -UQ -qS/ -a dir
- (( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space
- (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal
+ pref="${${word:#[~/]*}:+$PWD}/"
+ (( $#dir )) && compadd "$expl[@]" -fW "$pref" -UQ -qS/ -a dir
+ (( $#space )) && compadd "$expl[@]" -fW "$pref" -UQ -qS " " -a space
+ (( $#normal )) && compadd "$expl[@]" -fW "$pref" -UQ -qS "" -a normal
fi
if _requested all-expansions; then
local disp dstr