summaryrefslogtreecommitdiff
path: root/Completion/Base/Utility
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2019-01-05 13:25:18 +0100
committerAxel Beckert <abe@deuxchevaux.org>2019-01-05 13:25:18 +0100
commit7e6a3d73413ad665a87cecf39d1dd05a91c1a31e (patch)
tree6e826685afbd476b340d311d2c08af12b3e81a8e /Completion/Base/Utility
parentfeaf8570c138e4372ae9517f1f5658ae74640c41 (diff)
parent325fceab3b4ffa871777bacc420e0e8efcb0afb9 (diff)
downloadzsh-7e6a3d73413ad665a87cecf39d1dd05a91c1a31e.tar.gz
zsh-7e6a3d73413ad665a87cecf39d1dd05a91c1a31e.zip
New upstream release candidate 5.6.2-test-3
Merge branch 'upstream' at 'zsh-5.6.2-test-3' into branch debian
Diffstat (limited to 'Completion/Base/Utility')
-rw-r--r--Completion/Base/Utility/_alternative4
-rw-r--r--Completion/Base/Utility/_multi_parts16
2 files changed, 12 insertions, 8 deletions
diff --git a/Completion/Base/Utility/_alternative b/Completion/Base/Utility/_alternative
index bfb34a604..3c61d1125 100644
--- a/Completion/Base/Utility/_alternative
+++ b/Completion/Base/Utility/_alternative
@@ -43,8 +43,10 @@ while _tags; do
# Anything inside `(...)' is added directly.
+ eval ws\=\( "${action[2,-2]}" \)
+
_all_labels "${def%%:*}" expl "$descr" \
- compadd "$subopts[@]" - ${=action[2,-2]}
+ compadd "$subopts[@]" -a - ws
elif [[ "$action" = \{*\} ]]; then
# A string in braces is evaluated.
diff --git a/Completion/Base/Utility/_multi_parts b/Completion/Base/Utility/_multi_parts
index 3e2f36c9c..12ff965ed 100644
--- a/Completion/Base/Utility/_multi_parts
+++ b/Completion/Base/Utility/_multi_parts
@@ -127,8 +127,7 @@ while true; do
return
fi
elif (( $#tmp1 )); then
- local ret=1 tt
- local -a mm
+ local ret=1
# More than one match. First we get all strings that match the
# rest from the line.
@@ -145,11 +144,14 @@ while true; do
SUFFIX="$suf"
fi
- for tt in $tmp1
- do
- mm+=( "${(@M)matches:#$tt*}" )
- done
- matches=( $mm )
+ # The purpose of this check (or one purpose, anyway) seems to be to ensure
+ # that the suffix for the current segment on the command line doesn't
+ # match across segments. For example, we want $matches for a<TAB>c to
+ # include abc/d, but not abd/c. If we don't have anything on the command
+ # line for this segment, though, we can skip it. (The difference is only
+ # noticeable when there are a huge number of possibilities)
+ [[ -n $pre$suf ]] &&
+ matches=( ${(@M)matches:#(${(j<|>)~${(@b)tmp1}})*} )
if ! zstyle -t ":completion:${curcontext}:" expand suffix ||
[[ -n "$menu" || -z "$compstate[insert]" ]]; then