From 6623bb41b98142c24607790dc8311435d1c33257 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 25 Apr 2000 10:28:11 +0000 Subject: report prefix/suffix of parameter expansion in IPREFIX/ISUFFIX; make _expand use them to be able to expand $foo (10909) --- Completion/Core/_expand | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Completion') diff --git a/Completion/Core/_expand b/Completion/Core/_expand index 2557af884..1a96e654e 100644 --- a/Completion/Core/_expand +++ b/Completion/Core/_expand @@ -11,7 +11,13 @@ setopt localoptions nullglob [[ _matcher_num -gt 1 ]] && return 1 -local exp word="$PREFIX$SUFFIX" sort expr expl subd suf=" " +local exp word sort expr expl subd suf=" " + +if [[ "$funcstack[2]" = _prefix ]]; then + word="$IPREFIX$PREFIX$SUFFIX" +else + word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" +fi # First, see if we should insert all *completions*. @@ -29,7 +35,7 @@ exp=("$word") # changes quoted spaces, tabs, and newlines into spaces. { zstyle -s ":completion:${curcontext}:" substitute expr || - [[ "$curcontext" = expand-word:* ]] && expr=1 } && + { [[ "$curcontext" = expand-word:* ]] && expr=1 } } && [[ "${(e):-\$[$expr]}" -eq 1 ]] && exp=( "${(e)exp//\\[ ]/ }" ) @@ -43,7 +49,7 @@ subd=("$exp[@]") # Now try globbing. { zstyle -s ":completion:${curcontext}:" glob expr || - [[ "$curcontext" = expand-word:* ]] && expr=1 } && + { [[ "$curcontext" = expand-word:* ]] && expr=1 } } && [[ "${(e):-\$[$expr]}" -eq 1 ]] && exp=( ${~exp} ) -- cgit 1.4.1