Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Fix zstyle option completion
- X-seq: zsh-workers 47737
- From: dana <dana@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] Fix zstyle option completion
- Date: Sat, 12 Dec 2020 22:15:47 -0600
- Archived-at: <https://zsh.org/workers/47737>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/D5C6BE91-013B-476D-BF33-505C72CF6FAC%40dana.is>
- Authentication-results: zsh.org; iprev=pass (mail-il1-f177.google.com) smtp.remote-ip=209.85.166.177; dkim=pass header.d=dana-is.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=dana.is; arc=none
- Cc: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :cc:to; bh=x4xTJvS0DmuHGdJi4RKz5JEYx/tHhTYZECVnZc8nS+E=; b=Evcb/EUAgF2Q2Yt/dk56ipadLwmFD3L7MSlFRqTf85AzQake9qwQU29FrdHfvSDClU FazX6YbjSvTH0yP/pjgb+giAQARdx2BERBXOxsXSVdFMjjXeVK1McdQJ1krY01uCUSZj GKrN4Xn7FXZnWWXrCs5qfFRmSLZJnNri93KptZgXclrWayKQPG32GwFJwymgRJFqs/p0 dn+2vn89LoLPpFoUMEYPeFWgz6Ucxjl9/O9799xxRuE3gvqh4n3h9sb73iL4XlXov/B9 oReMM68Dp2I/nkpRK4E/ANT2P66eocIppYRPyIHO7SxcTAMaddh/J98j3OnipgzmgRQZ XfxQ==
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- Sender: zsh-workers-request@xxxxxxx
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