From 35b2633ad941966f5fca07b625a594a5b68c0fdb Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 15 Nov 1999 12:01:46 +0000 Subject: manual/8639 --- Completion/Base/_subscript | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'Completion/Base/_subscript') diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript index c5c6ca7e9..80a3b1720 100644 --- a/Completion/Base/_subscript +++ b/Completion/Base/_subscript @@ -3,30 +3,25 @@ local expl if [[ "$PREFIX" = :* ]]; then - _tags any char-classes || return 1 - - _description expl 'character class' - compadd "$expl[@]" -p: -S ':]' alnum alpha blank cntrl digit graph \ - lower print punct space upper xdigit + _wanted char-classes expl 'character class' && + compadd "$expl[@]" -p: -S ':]' alnum alpha blank cntrl digit graph \ + lower print punct space upper xdigit elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then - _tags any association-keys || return 1 - - _description expl 'association key' - if [[ "$RBUFFER" = \]* ]]; then - compadd "$expl[@]" -S '' - "${(@kP)${compstate[parameter]}}" - else - compadd "$expl[@]" -S ']' - "${(@kP)${compstate[parameter]}}" - fi + _wanted association-keys expl 'association key' && + if [[ "$RBUFFER" = \]* ]]; then + compadd "$expl[@]" -S '' - "${(@kP)${compstate[parameter]}}" + else + compadd "$expl[@]" -S ']' - "${(@kP)${compstate[parameter]}}" + fi elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then local list i j ret=1 disp - _tags any indexes parameters + _tags indexes parameters while _tags; do - if _requested indexes; then - _description -V expl 'array index' + if _requested indexes -V expl 'array index'; then ind=( {1..${#${(P)${compstate[parameter]}}}} ) - if _style indexes description yes; then + if _style indexes description; then list=() for i in "$ind[@]"; do [[ "$i" = ${PREFIX}*${SUFFIX} ]] && -- cgit 1.4.1