Sublime Forum

Small bug in bracket matching logic

#1

Please have a look at these screenshots:

  1. caret at column 40:
    http://i.imgur.com/utZNh3G.png

  2. caret at column 41:
    http://i.imgur.com/fpziSWY.png

Closing bracket (at column 40) is skipped from validation. Problem seems to be opening square bracket next to double closed brackets (as in this case) and probably in similar situations.
Type of bracket doesn’t play any role i.e. it’s same if square bracket in regular bracket, but it’s easier to demonstrate this way

0 Likes

#2

This is because ST2 is inconsistent with its matching rules; it needs a consistent rule saying if presented with two choices, always pick (left or right). You can try the BracketHighlighter plugin here which has a more consistent matching in this regard: github.com/facelessuser/BracketHighlighter. If you find it too flashy or not enough, you can configure it to be more so or less so.

But, yes, I feel this should be fixed in ST as well.

0 Likes