Skip to content

Commit

Permalink
Update LaTex grammar (#4528)
Browse files Browse the repository at this point in the history
Fix comment injection & add highlighting for math delimiters.
  • Loading branch information
Triton171 authored Oct 30, 2022
1 parent 00cf12f commit 908529c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ indent = { tab-width = 4, unit = "\t" }

[[grammar]]
name = "latex"
source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "b3b2cf27f33e71438ebe46934900b1153901c6f2" }
source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "8c75e93cd08ccb7ce1ccab22c1fbd6360e3bcea6" }

[[language]]
name = "lean"
Expand Down
6 changes: 6 additions & 0 deletions runtime/queries/latex/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/latex/injections.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
((comment) @injection.content
((line_comment) @injection.content
(#set! injection.language "comment"))

0 comments on commit 908529c

Please sign in to comment.