11local HL_POSITION = require (" nvim-tree.enum" ).HL_POSITION
22local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
33
4- --- @class Decorator
5- --- @field protected enabled boolean
6- --- @field protected hl_pos HL_POSITION
7- --- @field protected icon_placement ICON_PLACEMENT
4+ --- @class Decorator
5+ --- @field protected enabled boolean
6+ --- @field protected hl_pos HL_POSITION
7+ --- @field protected icon_placement ICON_PLACEMENT
88local Decorator = {}
99
10- --- @param o Decorator | nil
11- --- @return Decorator
10+ --- @param o Decorator | nil
11+ --- @return Decorator
1212function Decorator :new (o )
1313 o = o or {}
1414 setmetatable (o , self )
@@ -18,9 +18,9 @@ function Decorator:new(o)
1818end
1919
2020--- Maybe highlight groups
21- --- @param node table
22- --- @return string | nil icon highlight group
23- --- @return string | nil name highlight group
21+ --- @param node table
22+ --- @return string | nil icon highlight group
23+ --- @return string | nil name highlight group
2424function Decorator :groups_icon_name (node )
2525 local icon_hl , name_hl
2626
@@ -39,8 +39,8 @@ function Decorator:groups_icon_name(node)
3939end
4040
4141--- Maybe icon sign
42- --- @param node table
43- --- @return string | nil name
42+ --- @param node table
43+ --- @return string | nil name
4444function Decorator :sign_name (node )
4545 if not self .enabled or self .icon_placement ~= ICON_PLACEMENT .signcolumn then
4646 return
@@ -53,8 +53,8 @@ function Decorator:sign_name(node)
5353end
5454
5555--- Icons when ICON_PLACEMENT.before
56- --- @param node table
57- --- @return HighlightedString[] | nil icons
56+ --- @param node table
57+ --- @return HighlightedString[] | nil icons
5858function Decorator :icons_before (node )
5959 if not self .enabled or self .icon_placement ~= ICON_PLACEMENT .before then
6060 return
@@ -64,8 +64,8 @@ function Decorator:icons_before(node)
6464end
6565
6666--- Icons when ICON_PLACEMENT.after
67- --- @param node table
68- --- @return HighlightedString[] | nil icons
67+ --- @param node table
68+ --- @return HighlightedString[] | nil icons
6969function Decorator :icons_after (node )
7070 if not self .enabled or self .icon_placement ~= ICON_PLACEMENT .after then
7171 return
@@ -75,24 +75,24 @@ function Decorator:icons_after(node)
7575end
7676
7777--- Maybe icons, optionally implemented
78- --- @protected
79- --- @param _ table node
80- --- @return HighlightedString[] | nil icons
78+ --- @protected
79+ --- @param _ table node
80+ --- @return HighlightedString[] | nil icons
8181function Decorator :calculate_icons (_ )
8282 return nil
8383end
8484
8585--- Maybe highlight group, optionally implemented
86- --- @protected
87- --- @param _ table node
88- --- @return string | nil group
86+ --- @protected
87+ --- @param _ table node
88+ --- @return string | nil group
8989function Decorator :calculate_highlight (_ )
9090 return nil
9191end
9292
9393--- Define a sign
94- --- @protected
95- --- @param icon HighlightedString | nil
94+ --- @protected
95+ --- @param icon HighlightedString | nil
9696function Decorator :define_sign (icon )
9797 if icon and # icon .hl > 0 then
9898 local name = icon .hl [1 ]
0 commit comments