aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/latex
diff options
context:
space:
mode:
authorTriton1712022-10-30 16:45:58 +0000
committerGitHub2022-10-30 16:45:58 +0000
commit908529ccac153c12fd3b8e051a8f8ef68120d94d (patch)
tree91f842f6e4439ee7f280ff4dd1ddbfc3fea8cc51 /runtime/queries/latex
parent00cf12f571b72451bcdd5c2b0079ce2331a0869f (diff)
Update LaTex grammar (#4528)
Fix comment injection & add highlighting for math delimiters.
Diffstat (limited to 'runtime/queries/latex')
-rw-r--r--runtime/queries/latex/highlights.scm6
-rw-r--r--runtime/queries/latex/injections.scm2
2 files changed, 7 insertions, 1 deletions
diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm
index e39226a2..3174d80b 100644
--- a/runtime/queries/latex/highlights.scm
+++ b/runtime/queries/latex/highlights.scm
@@ -29,6 +29,12 @@
(#eq? @punctuation.delimiter "&"))
["[" "]" "{" "}"] @punctuation.bracket ; "(" ")" has no syntactical meaning in LaTeX
+(math_delimiter
+ left_command: _ @punctuation.delimiter
+ left_delimiter: _ @punctuation.delimiter
+ right_command: _ @punctuation.delimiter
+ right_delimiter: _ @punctuation.delimiter
+)
;; General environments
(begin
diff --git a/runtime/queries/latex/injections.scm b/runtime/queries/latex/injections.scm
index 321c90ad..d3fdb0ca 100644
--- a/runtime/queries/latex/injections.scm
+++ b/runtime/queries/latex/injections.scm
@@ -1,2 +1,2 @@
-((comment) @injection.content
+((line_comment) @injection.content
(#set! injection.language "comment"))