diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-25 10:28:11 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-25 10:28:11 +0000 |
commit | 6623bb41b98142c24607790dc8311435d1c33257 (patch) | |
tree | 6a9ca6c9a47515acec91959747edad70e1d55f05 /Completion/Core/_expand | |
parent | d49da606702363f0eb5615a341126c2dbe562849 (diff) | |
download | zsh-6623bb41b98142c24607790dc8311435d1c33257.tar.gz zsh-6623bb41b98142c24607790dc8311435d1c33257.tar.xz zsh-6623bb41b98142c24607790dc8311435d1c33257.zip |
report prefix/suffix of parameter expansion in IPREFIX/ISUFFIX; make _expand use them to be able to expand $foo (10909)
Diffstat (limited to 'Completion/Core/_expand')
-rw-r--r-- | Completion/Core/_expand | 12 |
1 files changed, 9 insertions, 3 deletions
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} ) |