about summary refs log tree commit diff
path: root/Completion/Zsh/Command/_zle
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-09-13 08:49:22 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-09-13 08:49:22 +0000
commitab175759b2b607ee2c161ff446931126c7cb2cd9 (patch)
treee7b16f99b587c535668c08a22230374f3216709f /Completion/Zsh/Command/_zle
parented7798ed07dde52fe2ff4eccb2d8ccab3adf8b42 (diff)
downloadzsh-ab175759b2b607ee2c161ff446931126c7cb2cd9.tar.gz
zsh-ab175759b2b607ee2c161ff446931126c7cb2cd9.tar.xz
zsh-ab175759b2b607ee2c161ff446931126c7cb2cd9.zip
Mikael: 28252: remove unnecessary loop causing errors
Diffstat (limited to 'Completion/Zsh/Command/_zle')
-rw-r--r--Completion/Zsh/Command/_zle62
1 files changed, 29 insertions, 33 deletions
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