Skip to content

Commit 1c68b1c

Browse files
Triton171pathwave
authored andcommitted
Update LaTex grammar (helix-editor#4528)
Fix comment injection & add highlighting for math delimiters.
1 parent c81c830 commit 1c68b1c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

languages.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ indent = { tab-width = 4, unit = "\t" }
570570

571571
[[grammar]]
572572
name = "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]]
576576
name = "lean"

runtime/queries/latex/highlights.scm

+6
Original file line numberDiff line numberDiff line change
@@ -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
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
((comment) @injection.content
1+
((line_comment) @injection.content
22
(#set! injection.language "comment"))

0 commit comments

Comments
 (0)