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

Re: Something else wrong with _multi_parts



Bart Schaefer wrote:

> Given something like
> 
> 	names=( foo bar home/test /usr/tmp /tmp/foo )
> 	_multi_parts / names
> 
> Only (/usr/tmp /tmp/foo) make it into the `matches' array in _multi_parts.
> I would have expected to be offered (foo bar home /) as the initial set of
> completions.

At one point while building this patch I got (with /<TAB>) the matches 
`/' and `home'. Somehow, this is correct, but I think the behaviour
this shows now is more intuitive.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_multi_parts Completion/Core/_multi_parts
--- ../z.old/Completion/Core/_multi_parts	Mon Feb 21 10:50:49 2000
+++ Completion/Core/_multi_parts	Mon Feb 21 10:59:05 2000
@@ -80,7 +80,11 @@
   # use the stuff from the line. This avoids having `foo' complete to
   # both `foo' and `foobar'.
 
-  tmp1=( "${(@M)matches:#${PREFIX}${SUFFIX}${sep}*}" )
+  if [[ -n "$PREFIX$SUFFIX" || "$pre" = ${sep}* ]]; then
+    tmp1=( "${(@M)matches:#${PREFIX}${SUFFIX}${sep}*}" )
+  else
+    tmp1=
+  fi
 
   if (( $#tmp1 )); then
     npref="${PREFIX}${SUFFIX}${sep}"

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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