From 8d6192baa9f78990cf784c57784506e60ce573c4 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sun, 4 Feb 2024 09:01:25 -0800 Subject: [PATCH] fix(latex): give comments higher precedence This commit also moves things around to give text better precedence in the case of `textit` and `textbf`. --- queries/latex/highlights.scm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/queries/latex/highlights.scm b/queries/latex/highlights.scm index aad68e4f7..a249d04bb 100644 --- a/queries/latex/highlights.scm +++ b/queries/latex/highlights.scm @@ -11,15 +11,6 @@ key: (_) @variable.parameter value: (_)) -[ - (line_comment) - (block_comment) - (comment_environment) -] @comment @spell - -((line_comment) @keyword.directive - (#lua-match? @keyword.directive "^%% !TeX")) - [ (brack_group) (brack_group_argc) @@ -164,12 +155,6 @@ (curly_group (_) @none @spell)) -; Math -[ - (displayed_equation) - (inline_formula) -] @markup.math - (math_environment (begin command: _ @markup.math @@ -313,6 +298,15 @@ (_) @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 +363,9 @@ (label_reference) @nospell (label_reference_range) @nospell + +; Math +[ + (displayed_equation) + (inline_formula) +] @markup.math