From 7e90f247e7b3add74a49895054a543c2140bbb08 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 3 Mar 2023 16:16:17 +0100 Subject: 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. --- src/nvim/lua/treesitter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 2db12b8ded..4cbe7329a6 100644 --- 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); -- cgit