summaryrefslogtreecommitdiffstats
path: root/Completion/Base/Core/_setup
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-06-06 12:35:52 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-06-06 12:35:52 -0700
commita253ada08b43fafa25d6af2cc3c0bf248df50970 (patch)
tree8c76edd9f61382e3bc8f6e9c58742f47c3bb19e7 /Completion/Base/Core/_setup
parent35350: extend "fc -I" to cover listing of "internal" history events only (diff)
downloadzsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.tar
zsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.tar.gz
zsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.tar.bz2
zsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.tar.lz
zsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.tar.xz
zsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.tar.zst
zsh-a253ada08b43fafa25d6af2cc3c0bf248df50970.zip
35163: move "show-ambiguity" style to _setup so that more precise context can be applied
Diffstat (limited to 'Completion/Base/Core/_setup')
-rw-r--r--Completion/Base/Core/_setup10
1 files changed, 8 insertions, 2 deletions
diff --git a/Completion/Base/Core/_setup b/Completion/Base/Core/_setup
index d85ebb885..ca975332f 100644
--- a/Completion/Base/Core/_setup
+++ b/Completion/Base/Core/_setup
@@ -9,8 +9,7 @@ if zstyle -a ":completion:${curcontext}:$1" list-colors val; then
if [[ "$1" = default ]]; then
_comp_colors=( "$val[@]" )
else
- _comp_colors=( "$_comp_colors[@]"
- "(${2})${(@)^val:#(|\(*\)*)}" "${(M@)val:#\(*\)*}" )
+ _comp_colors+=( "(${2})${(@)^val:#(|\(*\)*)}" "${(M@)val:#\(*\)*}" )
fi
# Here is the problem mentioned in _main_complete.
@@ -23,6 +22,13 @@ elif [[ "$1" = default ]]; then
unset ZLS_COLORS ZLS_COLOURS
fi
+# What we'd like is to test that the show-ambiguity style pattern is more
+# specific than the list-colors style pattern, but that's not possible yet
+if zstyle -s ":completion:${curcontext}:$1" show-ambiguity val; then
+ zmodload -i zsh/complist
+ [[ $val = (yes|true|on) ]] && _ambiguous_color=4 || _ambiguous_color=$val
+fi
+
if zstyle -t ":completion:${curcontext}:$1" list-packed; then
compstate[list]="${compstate[list]} packed"
elif [[ $? -eq 1 ]]; then