From 4bf681950b37f9b185e7d1628a07da90acdf9293 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 29 Jun 2000 08:09:45 +0000 Subject: don't expand partially typed parameter expansions (12118) --- Completion/Core/_expand | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Completion') 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. -- cgit 1.4.1