Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Something else wrong with _multi_parts
- X-seq: zsh-workers 9810
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Something else wrong with _multi_parts
- Date: Mon, 21 Feb 2000 11:01:31 +0100 (MET)
- In-reply-to: "Bart Schaefer"'s message of Mon, 21 Feb 2000 09:41:42 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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