From efdcfcfb61a64fee410268bed6a10bf3af7c781f Mon Sep 17 00:00:00 2001 From: Dusty Pomerleau Date: Mon, 26 Oct 2020 20:16:26 +1100 Subject: fix: narrow the case where angle brackets are seen as comparison operators --- editors/code/rust.tmGrammar.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 450116df2..1b8cc713a 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json @@ -641,10 +641,28 @@ }, { "comment": "less than, greater than (special case)", - "match": "(^|\\s)(?])\\s", + "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))", "captures": { + "1": { + "name": "punctuation.brackets.round.rust" + }, "2": { + "name": "punctuation.brackets.square.rust" + }, + "3": { + "name": "punctuation.brackets.curly.rust" + }, + "4": { "name": "keyword.operator.comparison.rust" + }, + "5": { + "name": "punctuation.brackets.round.rust" + }, + "6": { + "name": "punctuation.brackets.square.rust" + }, + "7": { + "name": "punctuation.brackets.curly.rust" } } }, -- cgit v1.2.3