From 2fe95056471071ff716e2efebfc0701ff310dcfc Mon Sep 17 00:00:00 2001 From: garinger Date: Tue, 12 Jul 2011 08:07:08 -0700 Subject: [PATCH] simplify check for bracket under cursor --- highlighters/brackets/brackets-highlighter.zsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/highlighters/brackets/brackets-highlighter.zsh b/highlighters/brackets/brackets-highlighter.zsh index 46ab7bd..675b4cd 100644 --- a/highlighters/brackets/brackets-highlighter.zsh +++ b/highlighters/brackets/brackets-highlighter.zsh @@ -79,10 +79,8 @@ _zsh_highlight_brackets_highlighter() fi done ((pos = CURSOR + 1)) - if [[ -n $levelpos[$pos] ]]; then - local otherpos - ((otherpos = -1)) - [[ -n $matching[$pos] ]] && otherpos=$matching[$pos] + if [[ -n $levelpos[$pos] ]] && [[ -n $matching[$pos] ]]; then + local otherpos=$matching[$pos] region_highlight+=("$((otherpos - 1)) $otherpos standout") fi }