mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
fix(treesitter): set match limit for query cursors
Upstream tree-sitter raised the number of pending matches for a query cursor from 32 to 64k in <https://github.com/tree-sitter/tree-sitter/commit/ 78010722a49ed6224c773c22b0d25a8c9fbde584>, which severely impacted performance for some highlighting queries. This uses the `ts_query_cursor_set_match_limit` function introduced in <https://github.com/tree-sitter/tree-sitter/commit/ cd96552448a6e0d4eb27fc54b27cb5130c4b6f76> to manually set this back to the old default of 32. Fixes #14897
This commit is contained in:
@@ -1073,6 +1073,7 @@ static int node_rawquery(lua_State *L)
|
|||||||
// TODO(bfredl): these are expensive allegedly,
|
// TODO(bfredl): these are expensive allegedly,
|
||||||
// use a reuse list later on?
|
// use a reuse list later on?
|
||||||
TSQueryCursor *cursor = ts_query_cursor_new();
|
TSQueryCursor *cursor = ts_query_cursor_new();
|
||||||
|
ts_query_cursor_set_match_limit(cursor, 32);
|
||||||
ts_query_cursor_exec(cursor, query, node);
|
ts_query_cursor_exec(cursor, query, node);
|
||||||
|
|
||||||
bool captures = lua_toboolean(L, 3);
|
bool captures = lua_toboolean(L, 3);
|
||||||
|
Reference in New Issue
Block a user