'brackets': Fix for one-based indexing

Use correct indexing also for cursor-matchingbracket.

Fixup for 95d82568d8
This commit is contained in:
m0viefreak
2016-05-11 00:31:39 +02:00
parent 2176692704
commit 5fe8fd8bdc
2 changed files with 41 additions and 2 deletions

View File

@@ -86,10 +86,10 @@ _zsh_highlight_brackets_highlighter()
done
# If cursor is on a bracket, then highlight corresponding bracket, if any
pos=$CURSOR
pos=$((CURSOR + 1))
if [[ -n $levelpos[$pos] ]] && [[ -n $matching[$pos] ]]; then
local -i otherpos=$matching[$pos]
_zsh_highlight_add_highlight $otherpos $((otherpos + 1)) cursor-matchingbracket
_zsh_highlight_add_highlight $((otherpos - 1)) $otherpos cursor-matchingbracket
fi
}