@@ -45,6 +45,7 @@ CONTENTS *nvim-tree*
4545 6.8 API Config | nvim-tree-api.config |
4646 6.9 API Commands | nvim-tree-api.commands |
4747 6.10 API Diagnostics | nvim-tree-api.diagnostics |
48+ 6.11 API Decorator | nvim-tree-api.decorator |
4849 7. Mappings | nvim-tree-mappings |
4950 7.1 Mappings: Default | nvim-tree-mappings-default |
5051 8. Highlight | nvim-tree-highlight |
@@ -949,6 +950,7 @@ Whether to show the destination of the symlink.
949950Highlighting and icons for the nodes, in increasing order of precedence.
950951Uses strings to specify builtin decorators otherwise specify your
951952`nvim_tree.api.decorator.UserDecorator` class.
953+ See | nvim-tree-decorators | , | nvim-tree-api.decorator |
952954 Type: `nvim_tree.api.decorator.Name[]` , Default: >lua
953955 {
954956 "Git",
@@ -2955,13 +2957,13 @@ Decorators may:
29552957- Set highlight group for the name or icons
29562958- Override node icon
29572959
2960+ See | nvim-tree-api.decorator |
2961+
29582962Create a `nvim_tree.api.decorator.UserDecorator` class and register it with
29592963precedence via | nvim-tree.renderer.decorators |
29602964
29612965See | nvim-tree-decorator-example |
29622966
2963- See `nvim- tree/_meta/ api_decorator.lua ` for full class documentation.
2964-
29652967==============================================================================
29662968 11.1. DECORATOR EXAMPLE *nvim-tree-decorator-example*
29672969
@@ -3444,5 +3446,65 @@ highlight group is not, hard linking as follows: >
34443446| nvim-tree-api.tree.winid() |
34453447
34463448==============================================================================
3449+ 6.11 API DECORATOR *nvim-tree-api.decorator*
3450+
3451+ *nvim_tree.api.decorator.UserDecorator*
3452+ Custom decorator, see :help nvim-tree-decorators
3453+
3454+ Fields: ~
3455+ • {enabled} (`boolean ` )
3456+ • {highlight_range} (`nvim_tree.api.decorator.HighlightRange` )
3457+ • {icon_placement} (`nvim_tree.api.decorator.IconPlacement` )
3458+ • {extend} (`fun(self: nvim_tree.api.decorator.UserDecorator)`)
3459+ See | UserDecorator:extend() | .
3460+ • {new} (`fun(self: nvim_tree.api.decorator.UserDecorator)`)
3461+ See | UserDecorator:new() | .
3462+ • {icon_node} (`fun(self: nvim_tree.api.decorator.UserDecorator, node: nvim_tree.api.Node): nvim_tree.api.HighlightedString?`)
3463+ See | UserDecorator:icon_node() | .
3464+ • {icons} (`fun(self: nvim_tree.api.decorator.UserDecorator, node: nvim_tree.api.Node): nvim_tree.api.HighlightedString[]?`)
3465+ See | UserDecorator:icons() | .
3466+ • {highlight_group} (`fun(self: nvim_tree.api.decorator.UserDecorator, node: nvim_tree.api.Node): string?`)
3467+ See | UserDecorator:highlight_group() | .
3468+
3469+
3470+ UserDecorator:extend() *nvim_tree.api.decorator.UserDecorator:extend()*
3471+ Create your decorator class
3472+
3473+ *nvim_tree.api.decorator.UserDecorator:highlight_group()*
3474+ UserDecorator:highlight_group({node} )
3475+ Abstract: optionally implement to provide one highlight group to apply to
3476+ your highlight_range.
3477+
3478+ Parameters: ~
3479+ • {node} (`nvim_tree.api.Node` )
3480+
3481+ Return: ~
3482+ (`string ?` ) highlight_group
3483+
3484+ *nvim_tree.api.decorator.UserDecorator:icon_node()*
3485+ UserDecorator:icon_node({node} )
3486+ Abstract: optionally implement to set the node's icon
3487+
3488+ Parameters: ~
3489+ • {node} (`nvim_tree.api.Node` )
3490+
3491+ Return: ~
3492+ (`nvim_tree.api.HighlightedString?` ) icon_node
3493+
3494+ *nvim_tree.api.decorator.UserDecorator:icons()*
3495+ UserDecorator:icons({node} )
3496+ Abstract: optionally implement to provide icons and the highlight groups
3497+ for your icon_placement.
3498+
3499+ Parameters: ~
3500+ • {node} (`nvim_tree.api.Node` )
3501+
3502+ Return: ~
3503+ (`nvim_tree.api.HighlightedString[]?` ) icons
3504+
3505+ UserDecorator:new() *nvim_tree.api.decorator.UserDecorator:new()*
3506+ Abstract: no-args constructor must be implemented and will be called once
3507+ per tree render. Must set all fields.
3508+
34473509
3448- vim:tw=78:ts=4 :sw=4:et:ft=help:norl:
3510+ vim:tw=78:ts=8 :sw=4:sts =4:et:ft=help:norl:
0 commit comments