about summary refs log tree commit diff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
authordana <dana@dana.is>2021-03-29 13:42:32 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2021-03-29 13:44:44 +0000
commit2ffd2928336154cf38ee390db835f25c685fe713 (patch)
treeef443e56e443bbc457a76a054c728cb51f9c4e5c /Completion/Zsh/Command
parentaebdbfd7baff25f360481992094efa3052adb99e (diff)
downloadzsh-2ffd2928336154cf38ee390db835f25c685fe713.tar.gz
zsh-2ffd2928336154cf38ee390db835f25c685fe713.tar.xz
zsh-2ffd2928336154cf38ee390db835f25c685fe713.zip
47737: _zstyle: Fix option completion when positional arguments are already present (regression from workers/39659 (commit ae3b675ce6e4ac62451ea08169c2b4dc45cf533b))
The following case:

    LBUFFER='zstyle -'
    RBUFFER=' foo bar'

Before this patch, completed 'context pattern' (from the first
positional argument).

With this patch, completes options, which is correct.
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_zstyle4
1 files changed, 2 insertions, 2 deletions
diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index 0473dd0fe..9d06076e4 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -218,7 +218,7 @@ taglist=(
 )
 
 # Be careful with the context arguments here.  They like to masquerade.
-_arguments -C \
+_arguments -C -A '-*' \
   '(: -)-L[output in form of zstyle commands]:pattern for context patterns:->metapatterns:style:->metastyles' \
   '(: -)-d[delete style definitions]:verbatim context pattern:->patterns:*:styles:->pstyles' \
   '(: -)-e[value is evaluated when style is looked up]:context pattern:->contexts:style:->styles:*:command:_cmdstring' \
@@ -229,7 +229,7 @@ _arguments -C \
   '(: -)-t[test a style, returning false if it'\''s undefined]:context name:->contexts:style:->styles:*:strings to test presence of: ' \
   '(: -)-T[test a style, returning true if it'\''s undefined]:context name:->contexts:style:->styles:*:strings to test presence of: ' \
   '(: -)-m[pattern-match values of a style]:context name:->contexts:style:->styles:pattern: ' \
-  '(-):context pattern:->contexts' '(-):style:->styles' '(-)*:argument:->style-arg'
+  ':context pattern:->contexts' ':style:->styles' '*:argument:->style-arg'
 
 while (( $#state )); do
   case "$state[1]" in