diff options
| author | Nat Williams <nat.williams@kin.com> | 2023-02-02 09:42:18 -0600 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-02-24 14:55:30 -0800 |
| commit | 34adfe8e95d31ba21c274ad11c6e16472ba5ef65 (patch) | |
| tree | 98e3c5e589d30138a145645ce812f727fc15a28f /doc | |
| parent | also pass the node to the statusline transform fn (diff) | |
| download | nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.tar nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.tar.gz nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.tar.bz2 nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.tar.lz nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.tar.xz nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.tar.zst nvim-treesitter-34adfe8e95d31ba21c274ad11c6e16472ba5ef65.zip | |
update docs for transform_fn
to reflect additional node argument
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/nvim-treesitter.txt | 5 |
1 files changed, 3 insertions, 2 deletions
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()* |
