I have noticed this specifically in PHP and on OSX but my guess is it is a global issue for ST2. (And yes I’m using inbuilt functionality, not the BracketsHighlighter plugin.)
If I have the following code:
if ($condition) {
// ...bunch of code...
}
If the ‘bunch of code’ stuff goes over maybe 100 lines (or some large amount of lines that goes over a-screen-height-and-a-bit worth of lines) then if you place the cursor next to the opening or closing bracket the matcher/highlighter appears to look like it’s working. Indentation guides highlight to the correct level, and the bracket has the underline. Great - but now I want to scroll up or down to the matching bracket to see where it was but leave my cursor next to the other bracket (because I’m going to want to insert here n a bit and just wanted to see if the closing bracket I’m on is for the right ‘if’ (say I have a load of nested 'if’s)). As I scroll everything looks like it works, until the bracket my cursor is next to is maybe 5 or so lines outside of the viewport, and then all of this highlighting stops. The matching bracket is not underlined and my indentation guides stop being highlighted as the correct indentation level. If I fold some code in betwene so that the brakctes are on the same screen or near enough to it, then the behaviour is correct, it’s just if there’s some scrolling involved.
My guess is that maybe for optimisation/resources purposes you kill the cursor when it’s far enough out of the viewport, but this has the unfortunate effect of also killing this highlighting and bracket matching.
I can make an exemplary video if you’d like. Hopefully it makes sense though.
Edit:
Just seen update to 2191 and can confirm it’s still present.
There also appears to be another bug where the brackets don’t match sometimes. This is likely due to my PHP code not being properly recognised by the parser (it is 100% valid PHP though!), and will be hard to debug what’s going on there.