From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] _widgets: Complete zle-* widgets too.
Date: Sat, 30 Jul 2016 13:11:57 +0000 [thread overview]
Message-ID: <1469884317-3192-1-git-send-email-danielsh@tarsus.local2> (raw)
---
Completion/Zsh/Type/_widgets | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Completion/Zsh/Type/_widgets b/Completion/Zsh/Type/_widgets
index fdab281..0e7f491 100644
--- a/Completion/Zsh/Type/_widgets
+++ b/Completion/Zsh/Type/_widgets
@@ -2,8 +2,14 @@
local expl pattern
+local -a fake
+autoload -U add-zle-hook-widget
+add-zle-hook-widget -h >&/dev/null # sets the zstyle
+zstyle -g fake zle-hook types
+fake=( zle-${^fake} )
+
pattern=( -g \* )
zparseopts -D -K -E g:=pattern
_description widgets expl widget
-compadd "$@" "$expl[@]" -M 'r:|-=* r:|=*' - "${(@k)widgets[(R)${pattern[2]}]}"
+compadd "$@" "$expl[@]" -M 'r:|-=* r:|=*' - "${(@k)widgets[(R)${pattern[2]}]}" "${(@M)fake:#${~pattern[2]}}"
next reply other threads:[~2016-07-30 13:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-30 13:11 Daniel Shahaf [this message]
2016-07-30 14:40 ` Bart Schaefer
2016-07-31 16:18 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469884317-3192-1-git-send-email-danielsh@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).