From 2ffd2928336154cf38ee390db835f25c685fe713 Mon Sep 17 00:00:00 2001 From: dana Date: Mon, 29 Mar 2021 13:42:32 +0000 Subject: 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. --- ChangeLog | 6 ++++++ Completion/Zsh/Command/_zstyle | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bab0cf02e..23c4a0707 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-03-29 dana + + * 47737: Completion/Zsh/Command/_zstyle: Fix option completion + when positional arguments are already present (regression from + workers/39659 (commit ae3b675ce6e4ac62451ea08169c2b4dc45cf533b)) + 2021-03-29 Daniel Shahaf * unposted: ChangeLog: Fix X-Seq numbers for the 39657, 39658, 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 -- cgit 1.4.1