From ab175759b2b607ee2c161ff446931126c7cb2cd9 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 13 Sep 2010 08:49:22 +0000 Subject: Mikael: 28252: remove unnecessary loop causing errors --- Completion/Zsh/Command/_zle | 62 +++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 33 deletions(-) (limited to 'Completion') diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle index a1fe136c5..80f217711 100644 --- a/Completion/Zsh/Command/_zle +++ b/Completion/Zsh/Command/_zle @@ -36,38 +36,34 @@ _arguments -s -S \ "(-L)-a[list all widgets]" \ '*:widget name:->widget' && ret=0 -while (( $#state )); do - case "$state[1]" in - (args) - _arguments \ - '(-N)-n[numeric prefix]:number:' \ - '(-n)-N[reset numeric prefix]' \ - '(-)*:widget arguments: ' && ret=0 - ;; - (widget*) - _wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0 - ;& - (function) - [[ $state[1] != *function ]] || # Handle fall-through - _wanted -C "$context[1]" functions expl 'widget shell function' \ - compadd -k functions && ret=0 - ;; - (comp-widget) - _wanted -C "$context[1]" widgets expl 'completion widget' \ - compadd -k "widgets[(R)(*:|)(.|)(${(j(|))compwids})(|:*)]" && ret=0 - ;& - (builtin-comp-widget) - _wanted -C "$context[1]" widgets expl 'builtin completion widget' \ - compadd -k "widgets[(I)(.|)(${(j(|))compwids})]" && ret=0 - ;; - (redisplay) - _arguments -s -S '!-R' \ - "-c[clear listing]" \ - ":status line" "*:strings to list" && ret=0 - ;; - esac - shift 1 state - shift 1 context -done +case "$state[1]" in + (args) + _arguments \ + '(-N)-n[numeric prefix]:number:' \ + '(-n)-N[reset numeric prefix]' \ + '(-)*:widget arguments: ' && ret=0 + ;; + (widget*) + _wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0 + ;& + (function) + [[ $state[1] != *function ]] || # Handle fall-through + _wanted -C "$context[1]" functions expl 'widget shell function' \ + compadd -k functions && ret=0 + ;; + (comp-widget) + _wanted -C "$context[1]" widgets expl 'completion widget' \ + compadd -k "widgets[(R)(*:|)(.|)(${(j(|))compwids})(|:*)]" && ret=0 + ;& + (builtin-comp-widget) + _wanted -C "$context[1]" widgets expl 'builtin completion widget' \ + compadd -k "widgets[(I)(.|)(${(j(|))compwids})]" && ret=0 + ;; + (redisplay) + _arguments -s -S '!-R' \ + "-c[clear listing]" \ + ":status line" "*:strings to list" && ret=0 + ;; +esac return ret -- cgit 1.4.1