Skip to content

Commit a35cdfb

Browse files
committed
Update r#""# auto-match to cooperate with raw identifiers.
This changes it so that it triggers on the quote instead of the #.
1 parent 9e877b1 commit a35cdfb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Default.sublime-keymap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
3838
]
3939
},
40-
// r# will expand to r#""#
40+
// r#" will expand to r#""#
4141
// Additional # characters will be duplicated on both sides.
42-
{ "keys": ["#"], "command": "insert_snippet", "args": {"contents": "#$1\"$0\"${1/[^#]/$1/}#"}, "context":
42+
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\"${TM_CURRENT_WORD/[^#]/$1/}"}, "context":
4343
[
4444
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
4545
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
4646
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
47-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "r$", "match_all": true },
47+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "r#+$", "match_all": true },
4848
{ "key": "selector", "operator": "equal", "operand": "source.rust" },
4949
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
5050
]

0 commit comments

Comments
 (0)