From a9da4e6c766311fb5cb706ff0d89b1c7d9b85820 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Wed, 5 Jan 2011 23:07:56 +0100 Subject: [PATCH] Harmonize exported variables names --- zsh-syntax-highlighting.zsh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 8c40d07..4cfb89a 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -32,6 +32,17 @@ ZSH_HIGHLIGHT_STYLES=( bracket-error 'fg=red,bold' ) +# Colors for bracket levels. +# Put as many color as you wish. +# Leave it as an empty array to disable. +ZSH_HIGHLIGHT_MATCHING_BRACKETS_STYLES=( + 'fg=blue,bold' + 'fg=green,bold' + 'fg=magenta,bold' + 'fg=yellow,bold' + 'fg=cyan,bold' +) + # Tokens that are always followed by a command. ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS=( '|' @@ -53,17 +64,6 @@ ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS=( 'whereis' ) -# Colors for bracket levels -# Put as many color as you wish -# Leave it as an empty array to disable -ZSH_MATCHING_BRACKETS=( - 'fg=blue,bold' - 'fg=green,bold' - 'fg=magenta,bold' - 'fg=yellow,bold' - 'fg=cyan,bold' -) - # ZLE highlight types. zle_highlight=( special:$ZSH_HIGHLIGHT_STYLES[special] @@ -169,7 +169,7 @@ _zsh_highlight-zle-buffer() { done # Bracket matching - bracket_color_size=${#ZSH_MATCHING_BRACKETS} + bracket_color_size=${#ZSH_HIGHLIGHT_MATCHING_BRACKETS_STYLES} if ((bracket_color_size > 0)); then typeset -A levelpos lastoflevel matching revmatching ((level = 0)) @@ -191,7 +191,7 @@ _zsh_highlight-zle-buffer() { if ((level < 1)); then region_highlight+=("$((pos - 1)) $pos "$ZSH_HIGHLIGHT_STYLES[bracket-error]) else - region_highlight+=("$((pos - 1)) $pos "$ZSH_MATCHING_BRACKETS[(( (level - 1) % bracket_color_size + 1 ))]) + region_highlight+=("$((pos - 1)) $pos "$ZSH_HIGHLIGHT_MATCHING_BRACKETS_STYLES[(( (level - 1) % bracket_color_size + 1 ))]) fi done ((c = CURSOR + 1))