From 1c619f5f20f33684b7b27a0c2c30143be7c44baa Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 23 Dec 2023 01:40:10 -0800 Subject: [PATCH] feat(luap): highlights more consistent with regex (#5819) --- queries/luap/highlights.scm | 15 ++++++++------- queries/regex/highlights.scm | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/queries/luap/highlights.scm b/queries/luap/highlights.scm index 62d2b3182..87e6c6908 100644 --- a/queries/luap/highlights.scm +++ b/queries/luap/highlights.scm @@ -1,9 +1,10 @@ -"." @character - [ (anchor_begin) (anchor_end) -] @string.escape +] @punctuation.delimiter + +(pattern + (character "." @variable.builtin)) [ "[" "]" @@ -19,17 +20,17 @@ (range from: (character) @constant - "-" @punctuation.delimiter + "-" @operator to: (character) @constant) (set (character) @constant) +(negated_set + (character) @constant) (class) @keyword -(negated_set - "^" @operator - (character) @constant) +(negated_set "^" @operator) (balanced_match (character) @parameter) diff --git a/queries/regex/highlights.scm b/queries/regex/highlights.scm index 7a5685844..3aa4af909 100644 --- a/queries/regex/highlights.scm +++ b/queries/regex/highlights.scm @@ -32,7 +32,8 @@ [ "*" "+" "?" "|" "=" "!" "-"] @operator [ - (any_character) (start_assertion) (end_assertion) -] @variable.builtin +] @punctuation.delimiter + +(any_character) @variable.builtin