You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lua/nvim-tree/_meta/api/decorator.lua
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,33 @@
1
1
---@meta
2
+
3
+
---@brief
4
+
---Highlighting and icons for nodes are provided by Decorators, see [nvim-tree-icons-highlighting]. You may provide your own in addition to the builtin decorators.
5
+
---
6
+
---Decorators may:
7
+
---- Add icons
8
+
---- Set highlight group for the name or icons
9
+
---- Override node icon
10
+
---
11
+
---To register your decorator:
12
+
---- Create a class that extends [nvim_tree.api.Decorator]
13
+
---- Register it by adding the class to [nvim_tree.config.renderer] {decorators}
14
+
---
15
+
---Your class must:
16
+
---- [nvim_tree.Class:extend()] the interface [nvim_tree.api.Decorator]
17
+
---- Provide a no-arguments constructor [nvim_tree.Class:new()] that sets the mandatory fields:
18
+
--- - {enabled}
19
+
--- - {highlight_range}
20
+
--- - {icon_placement}
21
+
---
22
+
---Your class may:
23
+
---- Implement methods to provide decorations:
24
+
--- - [nvim_tree.api.Decorator:highlight_group()]
25
+
--- - [nvim_tree.api.Decorator:icon_node()]
26
+
--- - [nvim_tree.api.Decorator:icons()]
27
+
---
28
+
---Your class must:
29
+
---- Call [nvim_tree.api.Decorator:define_sign()] in your constructor if using `"signcolumn"` {icon_placement}
0 commit comments