aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-11-24 14:46:20 +0100
committerluukvbaal <luukvbaal@gmail.com>2025-02-25 13:09:01 +0100
commit8ba047e33fe3a10765c593c810d54b5e3bb906e9 (patch)
treea31efbda695dcae1e1d31c738b72fec5669bf32f /runtime/doc
parentf58e7d5fac1c4f63f0ba3e59134591239182910e (diff)
downloadrneovim-8ba047e33fe3a10765c593c810d54b5e3bb906e9.tar.gz
rneovim-8ba047e33fe3a10765c593c810d54b5e3bb906e9.tar.bz2
rneovim-8ba047e33fe3a10765c593c810d54b5e3bb906e9.zip
feat(treesitter): vertical conceal support for highlighter
TSHighlighter now places marks for conceal_lines metadata. A new internal decor provider callback _on_conceal_line was added that instructs the highlighter to place conceal_lines marks whenever the editor needs to know whether a line is concealed. The bundled markdown queries use conceal_lines metadata to conceal code block fence lines.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/doc/treesitter.txt16
2 files changed, 13 insertions, 5 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 25f6255ed3..17de99730a 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -406,6 +406,8 @@ TREESITTER
• |LanguageTree:is_valid()| now accepts a range parameter to narrow the scope
of the validity check.
• |:InspectTree| now shows which nodes are missing.
+• Bundled markdown highlight queries use `conceal_lines` metadata to conceal
+ code block fence lines vertically.
TUI
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 344bd37ddd..db23576192 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -492,10 +492,10 @@ capture marks comments as to be checked: >query
There is also `@nospell` which disables spellchecking regions with `@spell`.
*treesitter-highlight-conceal*
-Treesitter highlighting supports |conceal| via the `conceal` metadata. By
-convention, nodes to be concealed are captured as `@conceal`, but any capture
-can be used. For example, the following query can be used to hide code block
-delimiters in Markdown: >query
+Treesitter highlighting supports |conceal| via the `conceal` and `conceal_lines`
+metadata. By convention, nodes to be concealed are captured as `@conceal`, but
+any capture can be used. For example, the following query can be used to hide
+code block delimiters in Markdown: >query
((fenced_code_block_delimiter) @conceal (#set! conceal ""))
<
@@ -506,7 +506,13 @@ still highlighted the same as other operators: >query
"!=" @operator (#set! conceal "≠")
<
-Conceals specified in this way respect 'conceallevel'.
+To conceal an entire line (do not draw it at all), a query with `conceal_lines`
+metadata can be used: >query
+
+ ((comment) @comment @spell
+ (#set! conceal_lines ""))
+<
+Conceals specified in this way respect 'conceallevel' and 'concealcursor'.
Note that although you can use any string for `conceal`, only the first
character will be used: >query