Skip to content

Commit 5146fb1

Browse files
committed
Restrict herestring bindings
1. don't trigger within comments 2. trigger only directly after `@` character, as otherwise typing quotation mark after `@foo` would also trigger the chain command. 3. trigger only if not directly followed by corresponding quotation or at-sign.
1 parent 60bcde3 commit 5146fb1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Default.sublime-keymap

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
},
1717
"context": [
1818
{ "key": "selection_empty", "match_all": true },
19-
{ "key": "selector", "operand": "source.powershell - string", "match_all": true },
20-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "@", "match_all": true },
19+
{ "key": "selector", "operand": "source.powershell - comment - string", "match_all": true },
20+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "@$", "match_all": true },
21+
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^[\"@]", "match_all": true },
2122
]
2223
},
2324
{
@@ -37,8 +38,9 @@
3738
},
3839
"context": [
3940
{ "key": "selection_empty", "match_all": true },
40-
{ "key": "selector", "operand": "source.powershell - string", "match_all": true },
41-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "@", "match_all": true },
41+
{ "key": "selector", "operand": "source.powershell - comment - string", "match_all": true },
42+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "@$", "match_all": true },
43+
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^['@]", "match_all": true },
4244
]
4345
},
4446
]

0 commit comments

Comments
 (0)