Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Further improvements to _mailboxes
- X-seq: zsh-workers 9951
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: Further improvements to _mailboxes
- Date: Wed, 1 Mar 2000 13:03:38 +0100 (MET)
- In-reply-to: "Bart Schaefer"'s message of Mon, 28 Feb 2000 18:00:16 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author