summaryrefslogtreecommitdiff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-07-28 16:12:59 +0200
committerOliver Kiddle <opk@zsh.org>2016-07-28 16:12:59 +0200
commit54d5f8e3632ca3698d90662d49d1320f91827078 (patch)
treeec6b15890fc84d277c9964a7395d940860d920bc /Completion/Zsh/Command
parent7830a8c498730cd08dad27d4d6ec9722f9cd637a (diff)
downloadzsh-54d5f8e3632ca3698d90662d49d1320f91827078.tar.gz
zsh-54d5f8e3632ca3698d90662d49d1320f91827078.zip
38956: factor out zle widget completion into its own function
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_bindkey7
-rw-r--r--Completion/Zsh/Command/_vared4
-rw-r--r--Completion/Zsh/Command/_zle8
3 files changed, 8 insertions, 11 deletions
diff --git a/Completion/Zsh/Command/_bindkey b/Completion/Zsh/Command/_bindkey
index 4c4aeda9d..81ae69974 100644
--- a/Completion/Zsh/Command/_bindkey
+++ b/Completion/Zsh/Command/_bindkey
@@ -27,14 +27,11 @@ _arguments -C -s -S \
'(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \
'(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \
'(-l -L -d -A -N -m -p -r -s):in-string' \
- '(-l -L -d -A -N -m -p -r -s)*::widgets:->widget' && ret=0
+ '(-l -L -d -A -N -m -p -r -s)*::widgets:_widgets' && ret=0
case $state in
keymap)
- _wanted -C -M keymaps expl keymap compadd -a keymaps && ret=0
- ;;
- widget)
- _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' -k widgets && ret=0
+ _wanted keymaps expl keymap compadd -a keymaps && ret=0
;;
esac
diff --git a/Completion/Zsh/Command/_vared b/Completion/Zsh/Command/_vared
index 2bcc87bc8..aba64880a 100644
--- a/Completion/Zsh/Command/_vared
+++ b/Completion/Zsh/Command/_vared
@@ -6,8 +6,8 @@ _arguments -s -A "-*" \
"-c[create parameter or change type]" \
'-p+[specify left prompt]:prompt' \
'-r+[specify right prompt]:right prompt' \
- '-i+[specify initialisation widget]:widget:compadd -M "r\:|-=* r\:|=*" -k widgets' \
- '-f+[specify finish widget]:widget:compadd -M "r\:|-=* r\:|=*" -k widgets' \
+ '-i+[specify initialisation widget]:widget:_widgets' \
+ '-f+[specify finish widget]:widget:_widgets' \
'-h[allow access to history]' \
'-e[exit on EOF (^D)]' \
'1:parameter spec:_vars'
diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle
index 3ed373348..f189b8fd9 100644
--- a/Completion/Zsh/Command/_zle
+++ b/Completion/Zsh/Command/_zle
@@ -48,20 +48,20 @@ case "$state[1]" in
'(-)*:widget arguments: ' && ret=0
;;
(widget*)
- _wanted -C "$context[1]" widgets expl "${state_descr[1]:-widget}" compadd -k widgets && ret=0
+ _wanted -C "$context[1]" widgets expl "${state_descr[1]:-widget}" _widgets && ret=0
;&
(function)
[[ $state[1] != *function ]] || # Handle fall-through
_wanted -C "$context[1]" functions expl 'widget shell function' \
- compadd -k functions && ret=0
+ compadd -M 'r:|-=* r:|=*' -k functions && ret=0
;;
(comp-widget)
_wanted -C "$context[1]" widgets expl 'completion widget' \
- compadd -k "widgets[(R)(*:|)(.|)(${(j(|))compwids})(|:*)]" && ret=0
+ _widgets -g "(*:|)(.|)(${(j(|))compwids})(|:*)" && ret=0
;&
(builtin-comp-widget)
_wanted -C "$context[1]" widgets expl 'builtin completion widget' \
- compadd -k "widgets[(I)(.|)(${(j(|))compwids})]" && ret=0
+ compadd -M 'r:|-=* r:|=*' -k "widgets[(I)(.|)(${(j(|))compwids})]" && ret=0
;;
(redisplay)
_arguments -s -S '!-R' \