'brackets': Allow unset ZSH_HIGHLIGHT_STYLES

Without this when bracket_color_size is 0,
    $(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
errors with division by zero.
This commit is contained in:
Matthew Martin 2016-01-20 00:38:44 -06:00
parent eaa4335c34
commit f73f3d53d3

View file

@ -76,7 +76,9 @@ _zsh_highlight_brackets_highlighter()
# Now highlight all found brackets
for pos in ${(k)levelpos}; do
if (( $+matching[$pos] )); then
style=bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
if (( bracket_color_size )); then
style=bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
fi
else
style=bracket-error
fi