Home Download Buy Blog Forum Support

BUG: parenthesis match

BUG: parenthesis match

Postby oats on Tue Sep 27, 2011 9:47 pm

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.
oats
 
Posts: 101
Joined: Mon Nov 09, 2009 4:39 pm

Re: BUG: parenthesis match

Postby facelessuser on Wed Sep 28, 2011 6:59 am

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.

Code: Select all
"match_brackets_angle": false,


With that said, I also noticed a situation such as:
Code: Select all
(())[]

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.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm

Re: BUG: parenthesis match

Postby oats on Wed Sep 28, 2011 7:32 pm

facelessuser wrote: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.

Agree. I think that would fix the problem.
oats
 
Posts: 101
Joined: Mon Nov 09, 2009 4:39 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 18 guests