diff options
| author | Thibault de Villèle <25150288+Thibaulltt@users.noreply.github.com> | 2025-09-05 11:12:12 +0200 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-09-19 10:35:18 +0200 |
| commit | c41b3b9841588e956663345cf01842a232d5eece (patch) | |
| tree | 12fbc03f577554994f02c3f60119099b36313fe2 /runtime | |
| parent | feat(latex)!: update parser and queries (diff) | |
| download | nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.tar nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.tar.gz nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.tar.bz2 nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.tar.lz nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.tar.xz nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.tar.zst nvim-treesitter-c41b3b9841588e956663345cf01842a232d5eece.zip | |
feat(latex): add counter nodes' highlight rules
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/queries/latex/highlights.scm | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm index 30602c907..3f195a13e 100644 --- a/runtime/queries/latex/highlights.scm +++ b/runtime/queries/latex/highlights.scm @@ -23,6 +23,9 @@ (curly_group_spec (text) @variable.parameter) +(curly_group_value + (value_literal) @constant) + (brack_group_argc) @variable.parameter [ @@ -85,6 +88,54 @@ declaration: (curly_group_command_name (_) @function)) +(counter_declaration + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable) + supercounter: (brack_group_word + (word) @variable)?) + +(counter_within_declaration + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable) + supercounter: (curly_group_word + (word) @variable)) + +(counter_without_declaration + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable) + supercounter: (curly_group_word + (word) @variable)) + +(counter_value + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +; The 'value' fields for the two following highlights +; are handled by counter_value and curly_group_value. +(counter_definition + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +(counter_addition + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +(counter_increment + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +(counter_typesetting + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + (label_definition command: _ @function.macro name: (curly_group_label @@ -298,6 +349,14 @@ ; Turn spelling off for whole nodes [ + (counter_declaration) + (counter_within_declaration) + (counter_without_declaration) + (counter_value) + (counter_definition) + (counter_addition) + (counter_increment) + (counter_typesetting) (label_reference) (label_reference_range) (label_number) |
