From 34adfe8e95d31ba21c274ad11c6e16472ba5ef65 Mon Sep 17 00:00:00 2001 From: Nat Williams Date: Thu, 2 Feb 2023 09:42:18 -0600 Subject: update docs for transform_fn to reflect additional node argument --- doc/nvim-treesitter.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 61507cb58..f2da04203 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -445,7 +445,7 @@ Default options (lua syntax): { indicator_size = 100, type_patterns = {'class', 'function', 'method'}, - transform_fn = function(line) return line:gsub('%s*[%[%(%{]*%s*$', '') end, + transform_fn = function(line, _node) return line:gsub('%s*[%[%(%{]*%s*$', '') end, separator = ' -> ' } < @@ -453,7 +453,8 @@ Default options (lua syntax): the beginning. - `type_patterns` - Which node type patterns to match. - `transform_fn` - Function used to transform the single item in line. By - default removes opening brackets and spaces from end. + default removes opening brackets and spaces from end. Takes two arguments: + the text of the line in question, and the corresponding treesitter node. - `separator` - Separator between nodes. *nvim_treesitter#foldexpr()* -- cgit v1.2.3-70-g09d2