1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00

moved from Completion/Builtins/_vars

This commit is contained in:
Sven Wischnowsky 2001-04-02 11:19:13 +00:00
parent 321a050f36
commit 01fa693061

25
Completion/Zsh/Type/_vars Normal file

@ -0,0 +1,25 @@
#compdef getopts unset vared
# This will handle completion of keys of associative arrays, e.g. at
# `vared foo[<TAB>'.
local ret=1
if [[ $PREFIX = *\[* ]]; then
compstate[parameter]=${PREFIX%%(|\\)\[*}
IPREFIX=${PREFIX%%\[*}\[
PREFIX=${PREFIX#*\[}
_subscript -q
else
_parameters -g '^a*' "$@" && ret=0
if compset -S '\[*'; then
set - -S "" "$@"
else
set - -qS"${${QIPREFIX:+[}:-\[}" "$@"
fi
_parameters -g 'a*' "$@" && ret=0
return ret
fi