File tree 4 files changed +14
-7
lines changed
4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,16 @@ function Explorer:new(path)
51
51
return
52
52
end
53
53
54
- --- @type Explorer
55
- local o = setmetatable ({
54
+ local o = {
56
55
opts = config ,
57
56
absolute_path = path ,
58
57
nodes = {},
59
58
open = true ,
60
59
sorters = Sorters :new (config ),
61
- }, Explorer )
62
- setmetatable (o , { __index = self })
60
+ }
61
+
62
+ setmetatable (o , self )
63
+ self .__index = self
63
64
64
65
o .watcher = watch .create_watcher (o )
65
66
o .renderer = Renderer :new (config , o )
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ local PICTURE_MAP = {
34
34
--- @field col_end number
35
35
36
36
--- @class (exact ) Builder
37
+ --- @field private __index ? table
37
38
--- @field lines string[] includes icons etc.
38
39
--- @field hl_args AddHighlightArgs[] line highlights
39
40
--- @field signs string[] line signs
@@ -79,7 +80,8 @@ function Builder:new(opts, explorer)
79
80
hidden_display = Builder :setup_hidden_display_function (opts ),
80
81
}
81
82
82
- setmetatable (o , { __index = self })
83
+ setmetatable (o , self )
84
+ self .__index = self
83
85
84
86
return o
85
87
end
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ local HL_POSITION = require("nvim-tree.enum").HL_POSITION
2
2
local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
3
3
4
4
--- @class (exact ) Decorator
5
+ --- @field private __index ? table
5
6
--- @field protected explorer Explorer
6
7
--- @field protected enabled boolean
7
8
--- @field protected hl_pos HL_POSITION
@@ -13,7 +14,8 @@ local Decorator = {}
13
14
function Decorator :new (o )
14
15
o = o or {}
15
16
16
- setmetatable (o , { __index = self })
17
+ setmetatable (o , self )
18
+ self .__index = self
17
19
18
20
return o
19
21
end
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ local namespace_extmarks_id = vim.api.nvim_create_namespace "NvimTreeExtmarks"
13
13
local namespace_virtual_lines_id = vim .api .nvim_create_namespace " NvimTreeVirtualLines"
14
14
15
15
--- @class (exact ) Renderer
16
+ --- @field private __index ? table
16
17
--- @field private opts table user options
17
18
--- @field private explorer Explorer
18
19
--- @field private builder Builder
@@ -29,7 +30,8 @@ function Renderer:new(opts, explorer)
29
30
builder = Builder :new (opts , explorer ),
30
31
}
31
32
32
- setmetatable (o , { __index = self })
33
+ setmetatable (o , self )
34
+ self .__index = self
33
35
34
36
return o
35
37
end
You can’t perform that action at this time.
0 commit comments