Update LaTex grammar (#4528)
Fix comment injection & add highlighting for math delimiters.
commit908529ccac153c12fd3b8e051a8f8ef68120d94d
authorTriton171 <daniel.ebert@protonmail.com>
dateSun 30 Oct 2022, 17:45 (4 years ago)
parent00cf12f
languages.toml+1−1
@@ -570,7 +570,7 @@ indent = { tab-width = 4, unit = "\t" }
570570
571571[[grammar]]
572572name = "latex"
573−source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "b3b2cf27f33e71438ebe46934900b1153901c6f2" }
573+source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "8c75e93cd08ccb7ce1ccab22c1fbd6360e3bcea6" }
574574
575575[[language]]
576576name = "lean"
runtime/queries/latex/highlights.scm+6
@@ -29,6 +29,12 @@
2929 (#eq? @punctuation.delimiter "&"))
3030
3131["[" "]" "{" "}"] @punctuation.bracket ; "(" ")" has no syntactical meaning in LaTeX
32+(math_delimiter
33+ left_command: _ @punctuation.delimiter
34+ left_delimiter: _ @punctuation.delimiter
35+ right_command: _ @punctuation.delimiter
36+ right_delimiter: _ @punctuation.delimiter
37+)
3238
3339;; General environments
3440(begin
runtime/queries/latex/injections.scm+1−1
@@ -1,2 +1,2 @@
1−((comment) @injection.content
1+((line_comment) @injection.content
22 (#set! injection.language "comment"))