about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-29 08:09:45 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-29 08:09:45 +0000
commit4bf681950b37f9b185e7d1628a07da90acdf9293 (patch)
tree84d85a794b0ead253894c20e0d8f1d25cf26f83d /Completion
parentd15f36ab5b7b2a15e9fc613de59e6ff1d586a7c7 (diff)
downloadzsh-4bf681950b37f9b185e7d1628a07da90acdf9293.tar.gz
zsh-4bf681950b37f9b185e7d1628a07da90acdf9293.tar.xz
zsh-4bf681950b37f9b185e7d1628a07da90acdf9293.zip
don't expand partially typed parameter expansions (12118)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_expand8
1 files changed, 5 insertions, 3 deletions
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 12c31860b..77d9c8794 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -33,7 +33,9 @@ else
   word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX"
 fi
 
-[[ "$word" = *\$\{[^\}]# ]] && return 1
+[[ "$word" = *\$(|\{[^\}]#) ||
+   ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] &&
+    return 1
 
 zstyle -T ":completion:${curcontext}:" suffix &&
   [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
@@ -44,8 +46,8 @@ zstyle -t ":completion:${curcontext}:" accept-exact ||
   { [[ "$word" = \~(|[-+]) ||
        ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ||
        ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -ne 1 ) ||
-       ( "$word" = \$[a-zA-Z0-9_]## && 
-         ${#parameters[(I)${word[2,-1]}*]} -ne 1 ) ]] && return 1 }
+       ( "$word" = *\$[a-zA-Z0-9_]## && 
+         ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && return 1 }
 
 # In exp we will collect the expansions.