From da6dc214ddde3fac867bd4a6f4ea51a794b01e18 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sat, 21 Jan 2023 23:10:32 +0200 Subject: [PATCH] highlights(json): conceal escaped quote --- queries/json/highlights.scm | 48 ++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/queries/json/highlights.scm b/queries/json/highlights.scm index f41b44a5a..c91e71f29 100644 --- a/queries/json/highlights.scm +++ b/queries/json/highlights.scm @@ -1,17 +1,33 @@ -(true) @boolean -(false) @boolean -(null) @constant.builtin -(number) @number -(pair key: (string) @label) -(pair value: (string) @string) -(array (string) @string) -(string_content (escape_sequence) @string.escape) -(string_content) @spell -(ERROR) @error -["," ":"] @punctuation.delimiter -"[" @punctuation.bracket -"]" @punctuation.bracket -"{" @punctuation.bracket -"}" @punctuation.bracket +[ + (true) + (false) +] @boolean -(("\"" @conceal) (#set! conceal "")) +(null) @constant.builtin + +(number) @number + +(pair + key: (string) @label + value: (string) @string) + +(array (string) @string) + +(string_content) @spell + +(ERROR) @error + +["," ":"] @punctuation.delimiter + +[ + "[" "]" + "{" "}" +] @punctuation.bracket + +(("\"" @conceal) + (#set! conceal "")) + +(escape_sequence) @string.escape +((escape_sequence) @conceal + (#eq? @conceal "\\\"") + (#set! conceal "\""))