summaryrefslogtreecommitdiffstats
path: root/Completion/Core
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-17 12:42:57 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-17 12:42:57 +0000
commit8ac5e93d9ec9f3363465d44f89a035d1f9948d08 (patch)
tree38cd28b4a0c258e531202f140489fc97327d0831 /Completion/Core
parentzsh-workers/9772 (diff)
downloadzsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.tar
zsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.tar.gz
zsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.tar.bz2
zsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.tar.lz
zsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.tar.xz
zsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.tar.zst
zsh-8ac5e93d9ec9f3363465d44f89a035d1f9948d08.zip
zsh-workers/9773
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_multi_parts25
1 files changed, 6 insertions, 19 deletions
diff --git a/Completion/Core/_multi_parts b/Completion/Core/_multi_parts
index 4a9b4192c..aa7a0507b 100644
--- a/Completion/Core/_multi_parts
+++ b/Completion/Core/_multi_parts
@@ -109,7 +109,8 @@ while true; do
PREFIX="${cpre}${pre}"
SUFFIX="$suf"
- if [[ $#imm -ne 0 && $#matches -eq 1 ]]; then
+ if [[ $#imm -ne 0 && $#matches -eq 1 ]] ||
+ zstyle -t ":completion:${curcontext}:" expand suffix; then
compadd "$group[@]" "$expl[@]" "$opts[@]" \
-M "r:|${sep}=* r:|=* $match" - "$pref$matches[1]"
else
@@ -142,7 +143,8 @@ while true; do
SUFFIX="$suf"
fi
- if [[ -n "$menu" || -z "$compstate[insert]" ]]; then
+ if ! zstyle -t ":completion:${curcontext}:" expand suffix ||
+ [[ -n "$menu" || -z "$compstate[insert]" ]]; then
# With menucompletion we add only the ambiguous component with
# the prefix collected and a spearator for the matches that
@@ -164,22 +166,6 @@ while true; do
-M "r:|${sep}=* r:|=* $match" - "$i"
fi
done
-
-# The old code and its comment:
-
- # With menucompletion we just add matches for the matching
- # components with the prefix we collected and the rest from the
- # line as a suffix.
-
-# tmp2="$pre$suf"
-# if [[ "$tmp2" = *${sep}* ]]; then
-# compadd "$group[@]" "$expl[@]" "$sopts[@]" \
-# -p "$pref" -s "${sep}${tmp2#*${sep}}" \
-# -M "r:|${sep}=* r:|=* $match" - "$tmp1[@]"
-# else
-# compadd "$group[@]" "$expl[@]" -p "$pref" "$sopts[@]" \
-# -M "r:|${sep}=* r:|=* $match" - "$tmp1[@]"
-# fi
else
# With normal completion we add all matches one-by-one with
# the unmatched part as a suffix. This will insert the longest
@@ -202,7 +188,8 @@ while true; do
# case we insert the expanded prefix we collected if it differs
# from the original string from the line.
- [[ "$orig" = "$pref$pre$suf" ]] && return 1
+ { ! zstyle -t ":completion:${curcontext}:" expand prefix ||
+ [[ "$orig" = "$pref$pre$suf" ]] } && return 1
PREFIX="${cpre}${pre}"
SUFFIX="$suf"