diff --git a/queries/latex/highlights.scm b/queries/latex/highlights.scm index 791689ff5..5d68cdfb0 100644 --- a/queries/latex/highlights.scm +++ b/queries/latex/highlights.scm @@ -126,48 +126,48 @@ ;; Sectioning (title_declaration command: _ @namespace - options: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + options: (brack_group (_) @text.title.1)? + text: (curly_group (_) @text.title.1)) (author_declaration command: _ @namespace authors: (curly_group_author_list - ((author)+ @text.title))) + ((author)+ @text.title.1))) (chapter command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.2)? + text: (curly_group (_) @text.title.2)) (part command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.2)? + text: (curly_group (_) @text.title.2)) (section command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.3)? + text: (curly_group (_) @text.title.3)) (subsection command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.4)? + text: (curly_group (_) @text.title.4)) (subsubsection command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.5)? + text: (curly_group (_) @text.title.5)) (paragraph command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.6)? + text: (curly_group (_) @text.title.6)) (subparagraph command: _ @namespace - toc: (brack_group (_) @text.title)? - text: (curly_group (_) @text.title)) + toc: (brack_group (_) @text.title.6)? + text: (curly_group (_) @text.title.6)) ;; Beamer frames (generic_environment diff --git a/queries/markdown/highlights.scm b/queries/markdown/highlights.scm index 5fc378e58..8867a4b7f 100644 --- a/queries/markdown/highlights.scm +++ b/queries/markdown/highlights.scm @@ -1,17 +1,13 @@ -;From MDeiml/tree-sitter-markdown -(atx_heading (inline) @text.title) -(setext_heading (paragraph) @text.title) +;From MDeiml/tree-sitter-markdown & Helix +(setext_heading (paragraph) @text.title.1 (setext_h1_underline) @text.title.1.marker) +(setext_heading (paragraph) @text.title.2 (setext_h2_underline) @text.title.2.marker) -[ - (atx_h1_marker) - (atx_h2_marker) - (atx_h3_marker) - (atx_h4_marker) - (atx_h5_marker) - (atx_h6_marker) - (setext_h1_underline) - (setext_h2_underline) -] @punctuation.special +(atx_heading (atx_h1_marker) @text.title.1.marker (inline) @text.title.1) +(atx_heading (atx_h2_marker) @text.title.2.marker (inline) @text.title.2) +(atx_heading (atx_h3_marker) @text.title.3.marker (inline) @text.title.3) +(atx_heading (atx_h4_marker) @text.title.4.marker (inline) @text.title.4) +(atx_heading (atx_h5_marker) @text.title.5.marker (inline) @text.title.5) +(atx_heading (atx_h6_marker) @text.title.6.marker (inline) @text.title.6) [ (link_title) @@ -19,6 +15,8 @@ (fenced_code_block) ] @text.literal +(info_string) @label + (pipe_table_header (pipe_table_cell) @text.title) (pipe_table_header "|" @punctuation.special) @@ -64,10 +62,4 @@ (backslash_escape) ] @string.escape -([ - (info_string) - (fenced_code_block_delimiter) -] @conceal -(#set! conceal "")) - (inline) @spell diff --git a/queries/markdown_inline/highlights.scm b/queries/markdown_inline/highlights.scm index 8369abffe..a70e34bb8 100644 --- a/queries/markdown_inline/highlights.scm +++ b/queries/markdown_inline/highlights.scm @@ -31,12 +31,10 @@ (hard_line_break) ] @string.escape -; "(" not part of query because of -; https://github.com/nvim-treesitter/nvim-treesitter/issues/2206 -; TODO: Find better fix for this -(image ["!" "[" "]" "(" ")"] @punctuation.delimiter) -(inline_link ["[" "]" "(" ")"] @punctuation.delimiter) -(shortcut_link ["[" "]"] @punctuation.delimiter) +(image "!" @punctuation.special) +(image ["[" "]" "(" ")"] @punctuation.bracket) +(inline_link ["[" "]" "(" ")"] @punctuation.bracket) +(shortcut_link ["[" "]"] @punctuation.bracket) ; Conceal codeblock and text style markers ([ diff --git a/queries/vimdoc/highlights.scm b/queries/vimdoc/highlights.scm index c0d88301b..e0dce49b2 100644 --- a/queries/vimdoc/highlights.scm +++ b/queries/vimdoc/highlights.scm @@ -1,7 +1,7 @@ -(h1) @text.title -(h2) @text.title -(h3) @text.title -(column_heading) @text.title +(h1) @text.title.1 +(h2) @text.title.2 +(h3) @text.title.3 +(column_heading) @text.title.4 (column_heading "~" @conceal (#set! conceal "")) (tag diff --git a/tests/query/highlights/markdown/test.md b/tests/query/highlights/markdown/test.md index 9423d3e85..2d3734515 100644 --- a/tests/query/highlights/markdown/test.md +++ b/tests/query/highlights/markdown/test.md @@ -1,8 +1,8 @@ # H1 - + ## H2 - + - Item 1 - Item 2 @@ -16,13 +16,13 @@ - - - + + + [link_text](#local_reference "link go brr...") - - + +