From 3c363ebd26a1da150108a3dd7c8ed3027dc20e85 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 16 Feb 2022 17:29:56 +0100 Subject: fix(latex): some highlight query fixes (#2534) * add \caption to @function * only highlight contents of curly text groups in references --- queries/latex/highlights.scm | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/queries/latex/highlights.scm b/queries/latex/highlights.scm index fff1e5b0..4e27f902 100644 --- a/queries/latex/highlights.scm +++ b/queries/latex/highlights.scm @@ -2,6 +2,8 @@ (ERROR) @error (command_name) @function +(caption + command: _ @function) (key_value_pair key: (_) @parameter @@ -72,22 +74,22 @@ declaration: (_) @function) (theorem_definition - command: _ @function.macro - name: (curly_group_text (_) @text.environment.name)) + command: _ @function.macro + name: (curly_group_text (_) @text.environment.name)) (label_definition command: _ @function.macro - name: (_) @text.reference) + name: (curly_group_text (_) @text.reference)) (label_reference_range command: _ @function.macro - from: (_) @text.reference - to: (_) @text.reference) + from: (curly_group_text (_) @text.reference) + to: (curly_group_text (_) @text.reference)) (label_reference command: _ @function.macro - names: (_) @text.reference) + names: (curly_group_text_list (_) @text.reference)) (label_number command: _ @function.macro - name: (_) @text.reference + name: (curly_group_text (_) @text.reference) number: (_) @text.reference) (citation @@ -95,25 +97,25 @@ keys: (curly_group_text_list) @text.reference) (glossary_entry_definition - command: _ @function.macro - name: (_) @text.reference) + command: _ @function.macro + name: (curly_group_text (_) @text.reference)) (glossary_entry_reference - command: _ @function.macro - name: (_) @text.reference) + command: _ @function.macro + name: (curly_group_text (_) @text.reference)) (acronym_definition - command: _ @function.macro - name: (_) @text.reference) + command: _ @function.macro + name: (curly_group_text (_) @text.reference)) (acronym_reference - command: _ @function.macro - name: (_) @text.reference) + command: _ @function.macro + name: (curly_group_text (_) @text.reference)) (color_definition - command: _ @function.macro - name: (_) @text.reference) + command: _ @function.macro + name: (curly_group_text (_) @text.reference)) (color_reference - command: _ @function.macro - name: (_) @text.reference) + command: _ @function.macro + name: (curly_group_text (_) @text.reference)) ;; Math [ -- cgit v1.2.3