From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29343 invoked from network); 1 Mar 2000 12:03:58 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Mar 2000 12:03:58 -0000 Received: (qmail 19580 invoked by alias); 1 Mar 2000 12:03:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9951 Received: (qmail 19542 invoked from network); 1 Mar 2000 12:03:44 -0000 Date: Wed, 1 Mar 2000 13:03:38 +0100 (MET) Message-Id: <200003011203.NAA26009@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 28 Feb 2000 18:00:16 +0000 Subject: Re: PATCH: Further improvements to _mailboxes Bart Schaefer wrote: > I'm still mysteriously getting a blank entry as the first item in a listing. > This *seems* to be coming from _multi_parts, as when I menu-complete the > first choice offered is `/' which doesn't appear in the listing anywhere. I think I found it now... the test if the string to add contained a separator character was too simple. Bye Sven diff -ru ../z.old/Completion/Core/_multi_parts Completion/Core/_multi_parts --- ../z.old/Completion/Core/_multi_parts Wed Mar 1 11:38:13 2000 +++ Completion/Core/_multi_parts Wed Mar 1 13:03:21 2000 @@ -162,14 +162,27 @@ tmp2=() fi for i in "${(@M)matches:#(${(j:|:)~tmp1})*}"; do - if [[ "$i" = *${sep}* ]]; then + case "$i" in + *${sep}) + compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ + -p "$pref" \ + -M "r:|${sep}=* r:|=* $match" - "${i%%${sep}*}" && ret=0 + ;; + ${sep}*) + compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ + -p "$pref" \ + -M "r:|${sep}=* r:|=* $match" - "$sep" && ret=0 + ;; + *${sep}*) compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ -p "$pref" \ -M "r:|${sep}=* r:|=* $match" - "${i%%${sep}*}" && ret=0 - else + ;; + *) compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" \ -M "r:|${sep}=* r:|=* $match" - "$i" && ret=0 - fi + ;; + esac done else # With normal completion we add all matches one-by-one with @@ -178,7 +191,7 @@ for i in "${(@M)matches:#(${(j:|:)~tmp1})*}"; do if [[ "$i" = *${sep}* ]]; then - compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ + compadd "$group[@]" "$expl[@]" "$opts[@]" \ -p "$pref" -s "${i#*${sep}}" \ -M "r:|${sep}=* r:|=* $match" - "${i%%${sep}*}" && ret=0 else -- Sven Wischnowsky wischnow@informatik.hu-berlin.de