about summary refs log tree commit diff
path: root/Completion/User/_colors
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-13 12:34:20 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-13 12:34:20 +0000
commit3fcbcf8a79b81230201f0e362eddb2399f4ca76e (patch)
treea7779ea5e23309f2c555a22d1fc07eb8127e2da5 /Completion/User/_colors
parent73af1e03100d32ef10bfd303a9b156d3c8e789aa (diff)
downloadzsh-3fcbcf8a79b81230201f0e362eddb2399f4ca76e.tar.gz
zsh-3fcbcf8a79b81230201f0e362eddb2399f4ca76e.tar.xz
zsh-3fcbcf8a79b81230201f0e362eddb2399f4ca76e.zip
zsh-workers/7430
Diffstat (limited to 'Completion/User/_colors')
-rw-r--r--Completion/User/_colors14
1 files changed, 4 insertions, 10 deletions
diff --git a/Completion/User/_colors b/Completion/User/_colors
index 797a7d7b3..7a7b0824b 100644
--- a/Completion/User/_colors
+++ b/Completion/User/_colors
@@ -5,16 +5,10 @@ if (( ! $+_color_cache )); then
 
   # Cache of color names doesn't exist yet, create it.
 
-  for f in /usr/{,local/,X11R6/,openwin/}lib/X11/rgb.txt
-  do
-    if [[ -f $f ]]; then
-      file=$f
-      break;
-    fi
-  done
+  file=( /usr/{lib,{{X11R6,openwin},local{,/X11{,R6}}}/lib}/X11/rgb.txt )
 
-  if [[ -n "$file" ]]; then
-    _color_cache=( "${(@)${(@f)$(< $file)}[2,-1]##*		}" )
+  if (( $#file )); then
+    _color_cache=( "${(@)${(@f)$(< $file[1])}[2,-1]##*		}" )
   else
 
     # Stupid default value.
@@ -23,4 +17,4 @@ if (( ! $+_color_cache )); then
   fi
 fi
 
-compadd - "$_color_cache[@]"
+compadd -M 'm:{a-z}={A-Z} m:-=\  r:|[ A-Z0-9]=* r:|=*' - "$_color_cache[@]"