aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-05-11 11:13:32 +0100
committerGitHub <noreply@github.com>2023-05-11 11:13:32 +0100
commitaf040c3a079f6e25db0ad6b908aa1327f67deb82 (patch)
treee5d90fd09f0c0cfcb99afb6ca7b564ba98fd31f0 /runtime/doc
parente90b506903babc84f8c5b796c3b25c7f20e183d2 (diff)
downloadrneovim-af040c3a079f6e25db0ad6b908aa1327f67deb82.tar.gz
rneovim-af040c3a079f6e25db0ad6b908aa1327f67deb82.tar.bz2
rneovim-af040c3a079f6e25db0ad6b908aa1327f67deb82.zip
feat(treesitter): add support for setting query depths
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/news.txt4
-rw-r--r--runtime/doc/treesitter.txt7
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index bc357ac534..6b1e9112c1 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -29,6 +29,7 @@ The following changes may require adaptations in user config or plugins.
set selectmode=mouse,key
set mousemodel=popup
set keymodel=startsel,stopsel
+<
==============================================================================
ADDED FEATURES *news-added*
@@ -52,6 +53,9 @@ iterators |luaref-in|.
• |'smoothscroll'| option to scroll by screen line rather than by text line
when |'wrap'| is set.
+• |Query:iter_matches()| now has the ability to set the maximum start depth
+ for matches.
+
==============================================================================
CHANGED FEATURES *news-changed*
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 0168b11499..d425c8dace 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -939,7 +939,7 @@ Query:iter_captures({self}, {node}, {source}, {start}, {stop})
metadata
*Query:iter_matches()*
-Query:iter_matches({self}, {node}, {source}, {start}, {stop})
+Query:iter_matches({self}, {node}, {source}, {start}, {stop}, {opts})
Iterates the matches of self on a given range.
Iterate over all matches within a {node}. The arguments are the same as
@@ -966,6 +966,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
• {source} (integer|string) Source buffer or string to search
• {start} (integer) Starting line for the search
• {stop} (integer) Stopping line for the search (end-exclusive)
+ • {opts} (table|nil) Options:
+ • max_start_depth (integer) if non-zero, sets the maximum
+ start depth for each match. This is used to prevent
+ traversing too deep into a tree. Requires treesitter >=
+ 0.20.9.
• {self}
Return: ~