From 6863f79118d3cb331fd4e726cdb2384bbd8bf8f2 Mon Sep 17 00:00:00 2001 From: Steven Sojka Date: Tue, 30 Mar 2021 08:18:24 -0500 Subject: refactor(all): language tree adaption (#1105) --- doc/nvim-treesitter.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 3d084e5e6..4bc47bff7 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -333,12 +333,16 @@ Swaps the nodes or ranges. set `cursor_to_second` to true to move the cursor to the second node *ts_utils.memoize_by_buf_tick* -memoize_by_buf_tick(fn)~ +memoize_by_buf_tick(fn, options)~ -Cache values by bufnr tick change +Caches the return value for a function and returns the cache value if the tick +of the buffer has not changed from the previous. - `fn`: a function that takes a bufnr as argument + `fn`: a function that takes any arguments and returns a value to store. + `options?`: + - `bufnr`: a function/value that extracts the bufnr from the given arguments. + - `key`: a function/value that extracts the cache key from the given arguments. `returns`: a function to call with bufnr as argument to retrieve the value from the cache -- cgit v1.2.3-70-g09d2