@@ -8,37 +8,32 @@ local rename_file = require("nvim-tree.actions.fs.rename-file")
88local trash = require (" nvim-tree.actions.fs.trash" )
99local utils = require (" nvim-tree.utils" )
1010
11+ local Class = require (" nvim-tree.classic" )
1112local DirectoryNode = require (" nvim-tree.node.directory" )
1213
13- --- @class Marks
14- --- @field config table hydrated user opts.filters
14+ --- @class (exact ) Marks : Class
1515--- @field private explorer Explorer
1616--- @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
3121
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 = {}
3530end
3631
3732--- Clear all marks and reload if watchers disabled
3833--- @private
3934function Marks :clear_reload ()
4035 self :clear ()
41- if not self .config .filesystem_watchers .enable then
36+ if not self .explorer . opts .filesystem_watchers .enable then
4237 self .explorer :reload_explorer ()
4338 end
4439end
@@ -100,7 +95,7 @@ function Marks:bulk_delete()
10095 self :clear_reload ()
10196 end
10297
103- if self .config .ui .confirm .remove then
98+ if self .explorer . opts .ui .confirm .remove then
10499 local prompt_select = " Remove bookmarked ?"
105100 local prompt_input = prompt_select .. " y/N: "
106101 lib .prompt (prompt_input , prompt_select , { " " , " y" }, { " No" , " Yes" }, " nvimtree_bulk_delete" , function (item_short )
@@ -129,7 +124,7 @@ function Marks:bulk_trash()
129124 self :clear_reload ()
130125 end
131126
132- if self .config .ui .confirm .trash then
127+ if self .explorer . opts .ui .confirm .trash then
133128 local prompt_select = " Trash bookmarked ?"
134129 local prompt_input = prompt_select .. " y/N: "
135130 lib .prompt (prompt_input , prompt_select , { " " , " y" }, { " No" , " Yes" }, " nvimtree_bulk_trash" , function (item_short )
0 commit comments