|
| 1 | +*decorator.txt* nvim-tree decorators |
| 2 | + |
| 3 | +============================================================================== |
| 4 | +============================================================================== |
| 5 | +Lua module: nvim_tree.api.decorator *nvim-tree-decorators* |
| 6 | + |
| 7 | +*nvim_tree.api.decorator.UserDecorator* |
| 8 | + Custom decorator, see :help nvim-tree-decorators |
| 9 | + |
| 10 | + Fields: ~ |
| 11 | + • {enabled} (`boolean`) |
| 12 | + • {highlight_range} (`nvim_tree.api.decorator.HighlightRange`) |
| 13 | + • {icon_placement} (`nvim_tree.api.decorator.IconPlacement`) |
| 14 | + • {extend} (`fun(self: nvim_tree.api.decorator.UserDecorator)`) |
| 15 | + See |UserDecorator:extend()|. |
| 16 | + • {new} (`fun(self: nvim_tree.api.decorator.UserDecorator)`) |
| 17 | + See |UserDecorator:new()|. |
| 18 | + • {icon_node} (`fun(self: nvim_tree.api.decorator.UserDecorator, node: nvim_tree.api.Node): nvim_tree.api.HighlightedString?`) |
| 19 | + See |UserDecorator:icon_node()|. |
| 20 | + • {icons} (`fun(self: nvim_tree.api.decorator.UserDecorator, node: nvim_tree.api.Node): nvim_tree.api.HighlightedString[]?`) |
| 21 | + See |UserDecorator:icons()|. |
| 22 | + • {highlight_group} (`fun(self: nvim_tree.api.decorator.UserDecorator, node: nvim_tree.api.Node): string?`) |
| 23 | + See |UserDecorator:highlight_group()|. |
| 24 | + |
| 25 | + |
| 26 | +UserDecorator:extend() *nvim_tree.api.decorator.UserDecorator:extend()* |
| 27 | + Create your decorator class |
| 28 | + |
| 29 | + *nvim_tree.api.decorator.UserDecorator:highlight_group()* |
| 30 | +UserDecorator:highlight_group({node}) |
| 31 | + Abstract: optionally implement to provide one highlight group to apply to |
| 32 | + your highlight_range. |
| 33 | + |
| 34 | + Parameters: ~ |
| 35 | + • {node} (`nvim_tree.api.Node`) |
| 36 | + |
| 37 | + Return: ~ |
| 38 | + (`string?`) highlight_group |
| 39 | + |
| 40 | + *nvim_tree.api.decorator.UserDecorator:icon_node()* |
| 41 | +UserDecorator:icon_node({node}) |
| 42 | + Abstract: optionally implement to set the node's icon |
| 43 | + |
| 44 | + Parameters: ~ |
| 45 | + • {node} (`nvim_tree.api.Node`) |
| 46 | + |
| 47 | + Return: ~ |
| 48 | + (`nvim_tree.api.HighlightedString?`) icon_node |
| 49 | + |
| 50 | + *nvim_tree.api.decorator.UserDecorator:icons()* |
| 51 | +UserDecorator:icons({node}) |
| 52 | + Abstract: optionally implement to provide icons and the highlight groups |
| 53 | + for your icon_placement. |
| 54 | + |
| 55 | + Parameters: ~ |
| 56 | + • {node} (`nvim_tree.api.Node`) |
| 57 | + |
| 58 | + Return: ~ |
| 59 | + (`nvim_tree.api.HighlightedString[]?`) icons |
| 60 | + |
| 61 | +UserDecorator:new() *nvim_tree.api.decorator.UserDecorator:new()* |
| 62 | + Abstract: no-args constructor must be implemented and will be called once |
| 63 | + per tree render. Must set all fields. |
| 64 | + |
| 65 | + |
| 66 | + vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: |
0 commit comments