diff options
Diffstat (limited to 'Completion/Zsh/Context')
-rw-r--r-- | Completion/Zsh/Context/_condition | 3 | ||||
-rw-r--r-- | Completion/Zsh/Context/_subscript | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/Completion/Zsh/Context/_condition b/Completion/Zsh/Context/_condition index 6f5e601f0..0285911ac 100644 --- a/Completion/Zsh/Context/_condition +++ b/Completion/Zsh/Context/_condition @@ -8,6 +8,8 @@ elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then _tags -C "$prev" files && _files elif [[ "$prev" = -t ]]; then _file_descriptors +elif [[ "$prev" = -v ]]; then + _parameters -r "\= \t\n\[\-" else if [[ "$PREFIX" = -* ]] || ! zstyle -T ":completion:${curcontext}:options" prefix-needed; then @@ -30,6 +32,7 @@ else -s:non-empty\ file -t:terminal\ file\ descriptor -u:setuid\ bit + -v:set\ variable -w:writable\ file -x:executable\ file -z:empty\ string diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript index 0ccc0c4ef..0c9a89ad5 100644 --- a/Completion/Zsh/Context/_subscript +++ b/Completion/Zsh/Context/_subscript @@ -62,6 +62,7 @@ elif compset -P '\('; then 'e[interpret * or @ as a single key]' );; (|scalar*)) flags=( + 'f[make subscripting work on lines of scalar]' 'w[make subscripting work on words of scalar]' 's[specify word separator]' 'p[recognise escape sequences in subsequent s flag]' @@ -81,8 +82,8 @@ elif compset -P '\('; then elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then local suf MATCH MBEGIN MEND local -a keys - keys=(${${(kP)compstate[parameter]}//(#m)[\$\\\[\]\(\)\[\{\}]/\\$MATCH}) - keys=(${keys//#%(#m)[*@]/(e)$MATCH}) + keys=("${(@)${(@k)${(P)compstate[parameter]}}//(#m)[\$\\\[\]\(\)\{\}]/\\$MATCH}") + keys=("${(@)keys//#%(#m)[*@]/(e)$MATCH}") [[ "$RBUFFER" != (|\\)\]* ]] && suf="$osuf" _wanted association-keys expl 'association key' \ @@ -99,10 +100,9 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then list=() for i in "$ind[@]"; do if [[ "$i" = ${PREFIX}*${SUFFIX} ]]; then - list=( "$list[@]" - "${i}:$(print -D ${(P)${compstate[parameter]}[$i]})" ) + list+=( "${i}:$(print -D -- ${(P)${compstate[parameter]}[$i]})" ) else - list=( "$list[@]" '' ) + list+=( '' ) fi done zstyle -s ":completion:${curcontext}:indexes" list-separator sep || sep=-- |