From bc42dc06f68aeaa85600b86d798974ddd3d43241 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 1 Mar 2000 12:20:55 +0000 Subject: zsh-workers/9951 --- Completion/Core/_multi_parts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Completion/Core') diff --git a/Completion/Core/_multi_parts b/Completion/Core/_multi_parts index 8b21d4df1..9e5906ac2 100644 --- a/Completion/Core/_multi_parts +++ b/Completion/Core/_multi_parts @@ -162,14 +162,27 @@ while true; do 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 - else + ;; + ${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 + ;; + *) 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 @@ while true; do 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 -- cgit 1.4.1