diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-13 12:34:20 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-13 12:34:20 +0000 |
commit | 3fcbcf8a79b81230201f0e362eddb2399f4ca76e (patch) | |
tree | a7779ea5e23309f2c555a22d1fc07eb8127e2da5 /Completion/User/_colors | |
parent | 73af1e03100d32ef10bfd303a9b156d3c8e789aa (diff) | |
download | zsh-3fcbcf8a79b81230201f0e362eddb2399f4ca76e.tar.gz zsh-3fcbcf8a79b81230201f0e362eddb2399f4ca76e.tar.xz zsh-3fcbcf8a79b81230201f0e362eddb2399f4ca76e.zip |
zsh-workers/7430
Diffstat (limited to 'Completion/User/_colors')
-rw-r--r-- | Completion/User/_colors | 14 |
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[@]" |