From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15743 invoked from network); 21 Feb 2000 10:03:03 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Feb 2000 10:03:03 -0000 Received: (qmail 4844 invoked by alias); 21 Feb 2000 10:02:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9810 Received: (qmail 4585 invoked from network); 21 Feb 2000 10:01:32 -0000 Date: Mon, 21 Feb 2000 11:01:31 +0100 (MET) Message-Id: <200002211001.LAA05566@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 21 Feb 2000 09:41:42 +0000 Subject: 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 /) 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@informatik.hu-berlin.de