diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-15 12:01:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-15 12:01:46 +0000 |
commit | 35b2633ad941966f5fca07b625a594a5b68c0fdb (patch) | |
tree | b54740d014e594ba5d81931cdcdb3387bcf9dfca /Completion/Base/_subscript | |
parent | bb98460a01ce1f6c1e71f7e401f782c81b71486b (diff) | |
download | zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip |
manual/8639
Diffstat (limited to 'Completion/Base/_subscript')
-rw-r--r-- | Completion/Base/_subscript | 29 |
1 files changed, 12 insertions, 17 deletions
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} ]] && |