Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: choice of completers from _prefix



When _prefix was changed to do better looping over completers,
_completer_num was declared local at the top and used for the looping.
Unfortunately, _main_complete's _completer_num is used below this point
to work out a completer list for when the style lookup fails.

The result is _prefix defaulting to all completers following the last
_prefix instead of those before the current.

The simple fix below is to move the local declaration.

Oliver

Index: Completion/Base/Completer/_prefix
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_prefix,v
retrieving revision 1.3
diff -u -r1.3 _prefix
--- Completion/Base/Completer/_prefix	9 Jul 2003 15:53:25 -0000	1.3
+++ Completion/Base/Completer/_prefix	5 Dec 2003 10:14:27 -0000
@@ -5,7 +5,7 @@
 [[ _matcher_num -gt 1 || -z "$SUFFIX" ]] && return 1
 
 local comp curcontext="$curcontext" tmp suf="$SUFFIX" \
-      _completer _completer_num \
+      _completer \
       _matcher _c_matcher _matchers _matcher_num
 
 zstyle -a ":completion:${curcontext}:" completer comp ||
@@ -18,7 +18,7 @@
 fi
 SUFFIX=''
 
-_completer_num=1
+local _completer_num=1
 
 for tmp in "$comp[@]"; do
   if [[ "$tmp" = *:-* ]]; then



Messages sorted by: Reverse Date, Date, Thread, Author