Sublime Forum

Add line in braces bug

#1

The Add line in Braces macro does not work on the enter key, and if you reassign to another key it will work as in this example

[
{ “keys”: [“ctrl+p”], “command”: “run_macro_file”, “args”: {“file”: “res://Packages/Default/Add Line in Braces.sublime-macro”}, “context”:
[
{ “key”: “setting.auto_indent”, “operator”: “equal”, “operand”: true },
{ “key”: “selection_empty”, “operator”: “equal”, “operand”: true, “match_all”: true },
{ “key”: “preceding_text”, “operator”: “regex_contains”, “operand”: “{$”, “match_all”: true },
{ “key”: “following_text”, “operator”: “regex_contains”, “operand”: “^}”, “match_all”: true }
]
},
]

0 Likes

#2

Sounds like any 3rd party package overwrites the default key binding.

ST runs through all key bindings in normal loading order (Default, Installed Packages/…, Packages/…, User) to find the command to execute. The last matching entry is executed. This allows packages to override the default bindings for certain circumstances or syntaxes.

0 Likes