neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 7e90f247e7b3add74a49895054a543c2140bbb08
parent bf90ceb5488ea2b41eb53335984f017785aefea9
Author: Christian Clason <c.clason@uni-graz.at>
Date:   Fri,  3 Mar 2023 16:16:17 +0100

fix(treesitter): raise ts_match_limit to 256 (#22497)

Problem: Some complex queries may not return all matches.

Solution: Raise `ts_match_limit` from current 64 (twice the original
default) to 256 (which Helix uses, and seems to be enough for the reported
problematic cases).

If this leads performance regressions in other queries, we should add a
generic querying timeout instead of relying on a low value here.
Diffstat:
Msrc/nvim/lua/treesitter.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c @@ -1319,7 +1319,7 @@ static int node_rawquery(lua_State *L) } else { cursor = ts_query_cursor_new(); } - ts_query_cursor_set_match_limit(cursor, 64); + ts_query_cursor_set_match_limit(cursor, 256); ts_query_cursor_exec(cursor, query, node); bool captures = lua_toboolean(L, 3);