highlights(latex): add more math environments

Fix #1293
This commit is contained in:
Stephan Seitz 2021-05-13 22:51:15 +02:00 committed by Thomas Vigouroux
parent bb2846fd9b
commit d89d698c26

View file

@ -8,15 +8,7 @@
((environment
(begin
name: (word) @_env)) @text.math
(#match? @_env "^(displaymath|equation|multline|eqnarray|align|array|split)[*]?$"))
;; This at the beginning of the file would be the alternative to highlight
;; only the interior of the environment
;((environment
;(begin
;name: (word) @_env) @none
;(end) @none) @text.math
;(#match? @_env "^(displaymath|eqn|eqnarray)[*]?$"))
(#match? @_env "^(displaymath|equation|multline|eqnarray|align|array|split|alignat|gather|flalign)[*]?$"))
[
(generic_command_name)
@ -380,7 +372,7 @@
(begin
name: (_) @text.environment.name
(#not-match? @text.environment.name "^(displaymath|equation|multline|eqnarray|align|array|split)[*]?$"))
(#not-match? @text.environment.name "^(displaymath|equation|multline|eqnarray|align|array|split|alignat|gather|flalign)[*]?$"))
(end
name: (_) @text.environment.name
(#not-match? @text.environment.name "^(displaymath|equation|multline|eqnarray|align|array|split)[*]?$"))
(#not-match? @text.environment.name "^(displaymath|equation|multline|eqnarray|align|array|split|alignat|gather|flalign)[*]?$"))