about summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-01 12:20:55 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-01 12:20:55 +0000
commitbc42dc06f68aeaa85600b86d798974ddd3d43241 (patch)
tree099231bfe72e9437b60f39819116f75f70b1d5cb /Completion/Core
parente3618518fde961fc283bffceeb804e63d45c84ce (diff)
downloadzsh-bc42dc06f68aeaa85600b86d798974ddd3d43241.tar.gz
zsh-bc42dc06f68aeaa85600b86d798974ddd3d43241.tar.xz
zsh-bc42dc06f68aeaa85600b86d798974ddd3d43241.zip
zsh-workers/9951
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_multi_parts21
1 files changed, 17 insertions, 4 deletions
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