Merge pull request #14915 from clason/ts-match-limit

fix(treesitter): set match limit for query cursors
This commit is contained in:
Björn Linse 2021-06-28 16:28:52 +02:00 committed by GitHub
commit 785dcff909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1073,6 +1073,7 @@ static int node_rawquery(lua_State *L)
// TODO(bfredl): these are expensive allegedly,
// use a reuse list later on?
TSQueryCursor *cursor = ts_query_cursor_new();
ts_query_cursor_set_match_limit(cursor, 32);
ts_query_cursor_exec(cursor, query, node);
bool captures = lua_toboolean(L, 3);