diff options
author | Riley Bruins <ribru17@hotmail.com> | 2024-09-01 16:54:30 -0700 |
---|---|---|
committer | Christian Clason <ch.clason+github@icloud.com> | 2025-01-05 12:28:01 +0100 |
commit | b61051ccb4c23958d43d285b8b801af11620264f (patch) | |
tree | ade40815a7e92af29910f3750d37e0192b6f4d7c /runtime/lua/vim/treesitter/query.lua | |
parent | 54ac406649b9e93d756ea62c1a6a587db462039c (diff) | |
download | rneovim-b61051ccb4c23958d43d285b8b801af11620264f.tar.gz rneovim-b61051ccb4c23958d43d285b8b801af11620264f.tar.bz2 rneovim-b61051ccb4c23958d43d285b8b801af11620264f.zip |
feat(func): allow manual cache invalidation for _memoize
This commit also adds some tests for the existing memoization
functionality.
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index f9c497337f..2b3b9096a6 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -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() |