mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 14:25:32 +00:00
feat(func): allow manual cache invalidation for _memoize
This commit also adds some tests for the existing memoization functionality.
This commit is contained in:
committed by
Christian Clason
parent
54ac406649
commit
b61051ccb4
@@ -902,8 +902,8 @@ function Query:iter_captures(node, source, start, stop)
|
||||
|
||||
local cursor = vim._create_ts_querycursor(node, self.query, start, stop, { match_limit = 256 })
|
||||
|
||||
local apply_directives = memoize(match_id_hash, self.apply_directives, true)
|
||||
local match_preds = memoize(match_id_hash, self.match_preds, true)
|
||||
local apply_directives = memoize(match_id_hash, self.apply_directives, false)
|
||||
local match_preds = memoize(match_id_hash, self.match_preds, false)
|
||||
|
||||
local function iter(end_line)
|
||||
local capture, captured_node, match = cursor:next_capture()
|
||||
|
||||
Reference in New Issue
Block a user