summaryrefslogtreecommitdiffstats
path: root/Completion/Core/_setup
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 08:47:43 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 08:47:43 +0000
commit4299878002e6caddc8f69b7e290f871934470ce9 (patch)
treeab6d11c5cced8e0863f3e618f8d53c4966031df1 /Completion/Core/_setup
parent11966: double brackets around comparison to prevent 'command not found: no' (diff)
downloadzsh-4299878002e6caddc8f69b7e290f871934470ce9.tar
zsh-4299878002e6caddc8f69b7e290f871934470ce9.tar.gz
zsh-4299878002e6caddc8f69b7e290f871934470ce9.tar.bz2
zsh-4299878002e6caddc8f69b7e290f871934470ce9.tar.lz
zsh-4299878002e6caddc8f69b7e290f871934470ce9.tar.xz
zsh-4299878002e6caddc8f69b7e290f871934470ce9.tar.zst
zsh-4299878002e6caddc8f69b7e290f871934470ce9.zip
restore ZLS_COLORS when possible; better group-name handling in ZLS_COLORS (3188)
Diffstat (limited to 'Completion/Core/_setup')
-rw-r--r--Completion/Core/_setup13
1 files changed, 12 insertions, 1 deletions
diff --git a/Completion/Core/_setup b/Completion/Core/_setup
index 6bc36e3ef..50e3dbfd8 100644
--- a/Completion/Core/_setup
+++ b/Completion/Core/_setup
@@ -2,12 +2,21 @@
local val nm="$compstate[nmatches]"
+[[ $# -eq 1 ]] && 2="$1"
+
if zstyle -a ":completion:${curcontext}:$1" list-colors val; then
zmodload -i zsh/complist
if [[ "$1" = default ]]; then
ZLS_COLORS="${(j.:.)${(@)val:gs/:/\\\:}}"
else
- eval "ZLS_COLORS=\"(${1})\${(j.:(${1}).)\${(@)val:gs/:/\\\:}}:\${ZLS_COLORS}\""
+ local simple grouped
+
+ simple=( "(${2})${(@)^val:#\(*\)*}" )
+ grouped=( "${(M@)val:#\(*\)*}" )
+ simple="${(j.:.)simple}:"
+ grouped="${(j.:.)grouped}:"
+ [[ "$ZLS_COLORS" != *${simple}* ]] && ZLS_COLORS="${simple}$ZLS_COLORS"
+ [[ "$ZLS_COLORS" != *${grouped}* ]] && ZLS_COLORS="${grouped}$ZLS_COLORS"
fi
# Here is the problem mentioned in _main_complete.
@@ -16,6 +25,8 @@ if zstyle -a ":completion:${curcontext}:$1" list-colors val; then
# zmodload -i zsh/complist
# ZLS_COLORS="$ZLS_COLORS$ZLS_COLOURS"
+elif [[ "$1" = default ]]; then
+ ZLS_COLORS=
fi
if zstyle -t ":completion:${curcontext}:$1" list-packed; then