Sublime Forum

BUG: parenthesis match

#1

test = (max(abs(err))<1)
test = (max(abs(err))>1)

As you cursor through the characters above, the 2nd inner parenthesis are not matched correctly in the first case, but are in the second case. In the first case, it skips from highlighting the 1st pair of parenthesis, and jumps to the 3rd pair. It seems to have something to do with the < sign immediately following the close-parenthesis.

I’m running 2122 on Win XP, Monokai, language is MATLAB.

0 Likes

#2

It is the angled brackets. You need to turn off angle matching in your file settings. I suspect it is trying to match the angled brackets and realizes they are not valid and then tries to match the the next outerset. There must be a bug in the algorithm that is throwing off the matching of the round brackets.

"match_brackets_angle": false,

With that said, I also noticed a situation such as:

(())]

Sublime Text cannot match the outer round brackets when coming from the right side. I assume this is because the algorithm is giving priority to the open square bracket. I do not think open brackets should take precedence. I think is should be more consistent, like if between two outside edges of brackets, default to left; it is more uniform and predictable and would avoid odd scenarios like this.

0 Likes

#3

Agree. I think that would fix the problem.

0 Likes