From a253ada08b43fafa25d6af2cc3c0bf248df50970 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 6 Jun 2015 12:35:52 -0700 Subject: 35163: move "show-ambiguity" style to _setup so that more precise context can be applied --- Completion/Base/Core/_setup | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Completion/Base/Core/_setup') 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 -- cgit 1.4.1