feat(latex): pre-compiled header highlights, tests

Also moves comment highlights to the very end to make them more
future-proof.
This commit is contained in:
Riley Bruins 2024-02-05 10:10:18 -08:00 committed by Christian Clason
parent 8d6192baa9
commit 127cf25737
2 changed files with 45 additions and 9 deletions

View file

@ -298,15 +298,6 @@
(_) @markup.link.url))
(#any-of? @_name "\\url" "\\href"))
[
(line_comment)
(block_comment)
(comment_environment)
] @comment @spell
((line_comment) @keyword.directive
(#lua-match? @keyword.directive "^%% !TeX"))
; File inclusion commands
(class_include
command: _ @keyword.import
@ -369,3 +360,15 @@
(displayed_equation)
(inline_formula)
] @markup.math
[
(line_comment)
(block_comment)
(comment_environment)
] @comment @spell
((line_comment) @keyword.directive
(#lua-match? @keyword.directive "^%% !TeX"))
((line_comment) @keyword.directive
(#lua-match? @keyword.directive "^%%&"))

View file

@ -0,0 +1,33 @@
% vim:ft=latex
% !TeX
% ^ @keyword.directive
%& filename
% ^ @keyword.directive
\begin{equation} \frac{4}{2} + 128 \text{hello} \sum_{n=1}^{\text{hi\_hi\^hi}} n \end{equation}
% ^ @markup.math ^ @none ^ @function
\begin{equation}
a = b % Comment here
% ^ @comment
% ^ @markup.math
\end{equation}
\begin{equation}
a = b % Comment here
% ^ @comment
b = c
\end{equation}
\text{
hi $here$ is some text % with a comment
% ^ @comment
% ^ @markup.math
}
\textbf{
here is some text $5 + 2$ % with a comment
% ^ @comment
% ^ @markup.math
}
\textit{
here is some text $5 + 2$ % with a comment
% ^ @comment
% ^ @markup.math
}