mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
brackets: Disallow negative nesting level
This commit is contained in:
parent
ac90970edc
commit
9dcfacc4a5
1 changed files with 9 additions and 5 deletions
|
|
@ -59,11 +59,15 @@ _zsh_highlight_highlighter_brackets_paint()
|
|||
lastoflevel[$level]=$pos
|
||||
;;
|
||||
[")]}"])
|
||||
matchingpos=$lastoflevel[$level]
|
||||
levelpos[$pos]=$((level--))
|
||||
if _zsh_highlight_brackets_match $matchingpos $pos; then
|
||||
matching[$matchingpos]=$pos
|
||||
matching[$pos]=$matchingpos
|
||||
if (( level > 0 )); then
|
||||
matchingpos=$lastoflevel[$level]
|
||||
levelpos[$pos]=$((level--))
|
||||
if _zsh_highlight_brackets_match $matchingpos $pos; then
|
||||
matching[$matchingpos]=$pos
|
||||
matching[$pos]=$matchingpos
|
||||
fi
|
||||
else
|
||||
levelpos[$pos]=-1
|
||||
fi
|
||||
;;
|
||||
['"'\'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue