Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _widgets: Complete zle-* widgets too.
- X-seq: zsh-workers 38972
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _widgets: Complete zle-* widgets too.
- Date: Sat, 30 Jul 2016 13:11:57 +0000
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
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]}}"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author