You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, I just exposed a simple problem but did not discoursed about how to actually fix and how it would affect other situations. A simple fix I did on my installation for now was this:
With this, I dumbly cut the insertion of the matching bracket, if any closing bracket was found. Indeed, this is not ideal. A more elegant solution would be to detect whether there are unbalanced brackets (this should be context aware, for example, if I inside a comment, and I am typing, this should isolate itself into that comment. But if I am on a code block, it should ignore comments and count all non-commented brackets and decide whether a matching bracket is missing/required. Then, fill it/fulfill it or do nothing.
Now I discoursed a little about its implementation, I think a plugin could do that "smart" behavior by overriding the default brackets keys [, (, etc. Or either this could be something a Language Server (LSP) could do/provide).
The text was updated successfully, but these errors were encountered:
auto_match_enabled
to insert a matching bracket when it is already there sublimehq/sublime_text#2982 (comment)The text was updated successfully, but these errors were encountered: