diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-19 11:18:05 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-19 11:18:05 +0000 |
commit | 9867c4091e71e6ed69889a9bfaee07275d2fa04e (patch) | |
tree | 37318116ff90f7b90df7cb9e894790d96be0849b /Completion/Base/_subscript | |
parent | 04979daf4f9b9645f22df1dfbb5974ab82294868 (diff) | |
download | zsh-9867c4091e71e6ed69889a9bfaee07275d2fa04e.tar.gz zsh-9867c4091e71e6ed69889a9bfaee07275d2fa04e.tar.xz zsh-9867c4091e71e6ed69889a9bfaee07275d2fa04e.zip |
manual/7448
Diffstat (limited to 'Completion/Base/_subscript')
-rw-r--r-- | Completion/Base/_subscript | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript index be5f08f62..090a5f07a 100644 --- a/Completion/Base/_subscript +++ b/Completion/Base/_subscript @@ -1,17 +1,22 @@ #compdef -subscript- +local expl + if [[ "$PREFIX" = :* ]]; then + _description expl 'character class' compadd -p: -S ':]' alnum alpha blank cntrl digit graph lower print punct \ space upper xdigit elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then + _description expl 'association key' if [[ "$RBUFFER" = \]* ]]; then - compadd -S '' - "${(@kP)${compstate[parameter]}}" + compadd "$expl[@]" -S '' - "${(@kP)${compstate[parameter]}}" else - compadd -S ']' - "${(@kP)${compstate[parameter]}}" + compadd "$expl[@]" -S ']' - "${(@kP)${compstate[parameter]}}" fi elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then local list i j + _description expl 'array index' ind=( {1..${#${(P)${compstate[parameter]}}}} ) list=() for i in "$ind[@]"; do @@ -21,9 +26,9 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then done if [[ "$RBUFFER" = \]* ]]; then - compadd -S '' -V default -y list - "$ind[@]" + compadd "$expl[@]" -S '' -V default -y list - "$ind[@]" else - compadd -S ']' -V default -y list - "$ind[@]" + compadd "$expl[@]" -S ']' -V default -y list - "$ind[@]" fi else _compalso -math- |