Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Fix zstyle option completion



I often retrieve zstyle commands from history and then edit them to add -d or
whatever at the beginning. But the completion function won't complete for you
there because of the change made by Daniel in workers/39659.

@Daniel: I think this achieves what you wanted without breaking my use case,
doesn't it? Or did you have something else in mind that i'm not seeing?

dana


diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index 75acde5f7..9e82d8ad5 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -217,7 +217,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' \
@@ -228,7 +228,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





Messages sorted by: Reverse Date, Date, Thread, Author