facelessuser wrote:Current highlighting favors what ever is to the left of it.
At the end, yes. When you're at the beginning, it favors what's on the right. Either way, you have to be one character away from a nested bracket in order for the surrounding pair to be highlighted.
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.
Oh, I definitely like consistent and predictable! Ask my wife. Hah hah. Not saying your way is wrong, just that I'd prefer something slightly different. I applaud you for wanting a consistent user experience!
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).
Shoot. That's what I get for not looking at the code and just jumping to an assumption. That's one Shame-On-You for Phillip!
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, string_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.
Thanks for the pointers. That will save a bit of head scratching.
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.
Thanks for the detailed response. I might tinker with it this weekend and see what happens. If I get it working the way I want, I'll submit a pull request. Otherwise an issue