Current highlighting favors what ever is to the left of it. ST2s built in bracket underlining is very similar, but actually less consistant which makes brackets not get underlined in certain scenarios.
I chose a very consistant and predictable way to highlight. I think this better illustrates what I am doing:
With that said, I can add the logic in, but you may have to wait a little. I have been doing quite a bit of plugin coding recently and I think I need a little break
The code is not done with regex...I think regex is the wrong tool for the job here (not to say it possibly can't be done with regex). I understand thought that not being done with regex doesn't always make the code easier to follow. If you really want to tinker with it and get this functionality before I get to it, you would probably look in adjacent_adjust
, and the very beginning of I think match_quotes
. The first I believe handles brackets intial highlighting, the second handles brackets inside strings initial highlighting, and the third handles quote initial highlighting in the beginning.
If you get it working and would like to do a pull request the main things that I require is that it is optional, and you don't break existing logic or functionality (the old method needs to work the same; it took me a little to iron logic out), and brakcets must be highlighted in some scenario no matter which direction the cursor comes from (cursor moving from left and cursor moving form right, the brackets need to fall into a scenario where they will always get highlighted.
That is it. If it is something you don't want to mess with, I will try and get to it sometime soon, just create an issue in github so I don't forget.