aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorTill Bungert <tillbungert@gmail.com>2023-10-01 21:10:51 +0200
committerGitHub <noreply@github.com>2023-10-01 14:10:51 -0500
commit9ce1623837a817c3f4f5deff9c8ba862578b6009 (patch)
treeddac08d5004967c2dcd848f4c44f6ca37fceed3a /runtime/doc
parentc0f4d60016676d4cde809107763a3bc51ad309b9 (diff)
downloadrneovim-9ce1623837a817c3f4f5deff9c8ba862578b6009.tar.gz
rneovim-9ce1623837a817c3f4f5deff9c8ba862578b6009.tar.bz2
rneovim-9ce1623837a817c3f4f5deff9c8ba862578b6009.zip
feat(treesitter): add foldtext with treesitter highlighting (#25391)
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/doc/treesitter.txt10
2 files changed, 12 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index f82cb7b7e0..db0c7b4407 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -145,6 +145,8 @@ The following new APIs and features were added.
• Added `vim.treesitter.query.edit()`, for live editing of treesitter
queries.
• Improved error messages for query parsing.
+ • Added |vim.treesitter.foldtext()| to apply treesitter highlighting to
+ foldtext.
• |vim.ui.open()| opens URIs using the system default handler (macOS `open`,
Windows `explorer`, Linux `xdg-open`, etc.)
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 34971c7acf..e19fda8fd1 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -560,6 +560,16 @@ foldexpr({lnum}) *vim.treesitter.foldexpr()*
Return: ~
(string)
+foldtext() *vim.treesitter.foldtext()*
+ Returns the highlighted content of the first line of the fold or falls
+ back to |foldtext()| if no treesitter parser is found. Can be set directly
+ to 'foldtext': >lua
+ vim.wo.foldtext = 'v:lua.vim.treesitter.foldtext()'
+<
+
+ Return: ~
+ `{ [1]: string, [2]: string[] }[]` | string
+
*vim.treesitter.get_captures_at_cursor()*
get_captures_at_cursor({winnr})
Returns a list of highlight capture names under the cursor