Skip to content

Commit

Permalink
[JavaScript] Tweak enter key binding
Browse files Browse the repository at this point in the history
This commit changes `enter` key binding to "Add Line in Braces" macro,
as it indents line between backticks using indentation rules instead of
forcing it to be indented via `\t`.

This works also, if indentation rules decide not to indent backticked contents.
  • Loading branch information
deathaxe committed Aug 6, 2024
1 parent 67d86e6 commit db36eca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions JavaScript/Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},

// Add indented line in square brackets
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context":
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
[
{ "key": "setting.auto_indent" },
{ "key": "selection_empty", "match_all": true },
Expand All @@ -62,7 +62,7 @@
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
]
},
{ "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context":
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
[
{ "key": "setting.auto_indent" },
{ "key": "selection_empty", "match_all": true },
Expand Down

0 comments on commit db36eca

Please sign in to comment.