From 09ef7f9740e72fd2b62459d88aad8960fe6e296f Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 21 Feb 2000 12:34:57 +0000 Subject: zsh-workers/9816 --- Completion/Core/_multi_parts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Completion/Core') diff --git a/Completion/Core/_multi_parts b/Completion/Core/_multi_parts index 92da26f9a..1d3841f86 100644 --- a/Completion/Core/_multi_parts +++ b/Completion/Core/_multi_parts @@ -83,7 +83,7 @@ while true; do if [[ -n "$PREFIX$SUFFIX" || "$pre" = ${sep}* ]]; then tmp1=( "${(@M)matches:#${PREFIX}${SUFFIX}${sep}*}" ) else - tmp1= + tmp1=() fi if (( $#tmp1 )); then @@ -233,10 +233,21 @@ while true; do PREFIX="${opre}${osuf}" SUFFIX="" - [[ -n "$pref" && "$orig" != "$pref" ]] && + if [[ -n "$pref" && "$orig" != "$pref" ]]; then + if [[ "$pref" = *${sep} ]]; then + compadd "$group[@]" "$expl[@]" "$opts[@]" \ + -p "${pref%${sep}*${sep}}${sep}" -S "$sep" \ + -M "r:|${sep}=* r:|=* $match" - "${${pref%${sep}}##*${sep}}" + + elif [[ "$pref" = *${sep}* ]]; then + compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ + -p "${pref%${sep}*}${sep}" \ + -M "r:|${sep}=* r:|=* $match" - "${pref##*${sep}}" + else compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ -M "r:|${sep}=* r:|=* $match" - "$pref" - + fi + fi return fi done -- cgit 1.4.1