about summary refs log tree commit diff
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
parentd15f36ab5b7b2a15e9fc613de59e6ff1d586a7c7 (diff)
downloadzsh-4bf681950b37f9b185e7d1628a07da90acdf9293.tar.gz
zsh-4bf681950b37f9b185e7d1628a07da90acdf9293.tar.xz
zsh-4bf681950b37f9b185e7d1628a07da90acdf9293.zip
don't expand partially typed parameter expansions (12118)
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Core/_expand8
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3eaf88a56..d3a7dd340 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-06-29  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 12118: Completion/Core/_expand: don't expand partially typed
+ 	parameter expansions
+	
 	* 12115: Completion/Core/_expand, Doc/Zsh/compsys.yo: change
  	suffix style to still do expansion if the suffix contains
  	something to expand
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.