1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

don't expand partially typed parameter expansions (12118)

This commit is contained in:
Sven Wischnowsky 2000-06-29 08:09:45 +00:00
parent d15f36ab5b
commit 4bf681950b
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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.