@@ -8,37 +8,32 @@ local rename_file = require("nvim-tree.actions.fs.rename-file")
8
8
local trash = require (" nvim-tree.actions.fs.trash" )
9
9
local utils = require (" nvim-tree.utils" )
10
10
11
+ local Class = require (" nvim-tree.classic" )
11
12
local DirectoryNode = require (" nvim-tree.node.directory" )
12
13
13
- --- @class Marks
14
- --- @field config table hydrated user opts.filters
14
+ --- @class (exact ) Marks : Class
15
15
--- @field private explorer Explorer
16
16
--- @field private marks table<string , Node> by absolute path
17
- local Marks = {}
18
-
19
- --- @return Marks
20
- --- @param opts table user options
21
- --- @param explorer Explorer
22
- function Marks :new (opts , explorer )
23
- local o = {
24
- explorer = explorer ,
25
- config = {
26
- ui = opts .ui ,
27
- filesystem_watchers = opts .filesystem_watchers ,
28
- },
29
- marks = {},
30
- }
17
+ local Marks = Class :extend ()
18
+
19
+ --- @class Marks
20
+ --- @overload fun ( args : MarksArgs ): Marks
31
21
32
- setmetatable (o , self )
33
- self .__index = self
34
- return o
22
+ --- @class (exact ) MarksArgs
23
+ --- @field explorer Explorer
24
+
25
+ --- @param args MarksArgs
26
+ function Marks :new (args )
27
+ self .explorer = args .explorer
28
+
29
+ self .marks = {}
35
30
end
36
31
37
32
--- Clear all marks and reload if watchers disabled
38
33
--- @private
39
34
function Marks :clear_reload ()
40
35
self :clear ()
41
- if not self .config .filesystem_watchers .enable then
36
+ if not self .explorer . opts .filesystem_watchers .enable then
42
37
self .explorer :reload_explorer ()
43
38
end
44
39
end
@@ -100,7 +95,7 @@ function Marks:bulk_delete()
100
95
self :clear_reload ()
101
96
end
102
97
103
- if self .config .ui .confirm .remove then
98
+ if self .explorer . opts .ui .confirm .remove then
104
99
local prompt_select = " Remove bookmarked ?"
105
100
local prompt_input = prompt_select .. " y/N: "
106
101
lib .prompt (prompt_input , prompt_select , { " " , " y" }, { " No" , " Yes" }, " nvimtree_bulk_delete" , function (item_short )
@@ -129,7 +124,7 @@ function Marks:bulk_trash()
129
124
self :clear_reload ()
130
125
end
131
126
132
- if self .config .ui .confirm .trash then
127
+ if self .explorer . opts .ui .confirm .trash then
133
128
local prompt_select = " Trash bookmarked ?"
134
129
local prompt_input = prompt_select .. " y/N: "
135
130
lib .prompt (prompt_input , prompt_select , { " " , " y" }, { " No" , " Yes" }, " nvimtree_bulk_trash" , function (item_short )
0 commit comments