@@ -11,11 +11,9 @@ local Class = require("nvim-tree.classic")
11
11
--- @class (exact ) View : Class
12
12
--- @field live_filter table
13
13
--- @field side string
14
- --- @field float table
15
14
--- @field private explorer Explorer
16
15
--- @field private adaptive_size boolean
17
16
--- @field private centralize_selection boolean
18
- --- @field private hide_root_folder boolean
19
17
--- @field private winopts table
20
18
--- @field private height integer
21
19
--- @field private preserve_window_proportions boolean
@@ -40,9 +38,7 @@ function View:new(args)
40
38
self .explorer = args .explorer
41
39
self .adaptive_size = false
42
40
self .centralize_selection = self .explorer .opts .view .centralize_selection
43
- self .float = self .explorer .opts .view .float
44
41
self .height = self .explorer .opts .view .height
45
- self .hide_root_folder = self .explorer .opts .renderer .root_folder_label == false
46
42
self .preserve_window_proportions = self .explorer .opts .view .preserve_window_proportions
47
43
self .side = (self .explorer .opts .view .side == " right" ) and " right" or " left"
48
44
self .live_filter = { prev_focused_node = nil , }
@@ -217,16 +213,16 @@ end
217
213
--- @private
218
214
--- @return table
219
215
function View :open_win_config ()
220
- if type (self .float .open_win_config ) == " function" then
221
- return self .float .open_win_config ()
216
+ if type (self .explorer . opts . view . float .open_win_config ) == " function" then
217
+ return self .explorer . opts . view . float .open_win_config ()
222
218
else
223
- return self .float .open_win_config
219
+ return self .explorer . opts . view . float .open_win_config
224
220
end
225
221
end
226
222
227
223
--- @private
228
224
function View :open_window ()
229
- if self .float .enable then
225
+ if self .explorer . opts . view . float .enable then
230
226
vim .api .nvim_open_win (0 , true , self :open_win_config ())
231
227
else
232
228
vim .api .nvim_command (" vsp" )
405
401
406
402
--- @param size string | number | nil
407
403
function View :resize (size )
408
- if self .float .enable and not self .adaptive_size then
404
+ if self .explorer . opts . view . float .enable and not self .adaptive_size then
409
405
-- if the floating windows's adaptive size is not desired, then the
410
- -- float size should be defined in view.float.open_win_config
406
+ -- float size should be defined in self.explorer.opts. view.float.open_win_config
411
407
return
412
408
end
413
409
761
757
--- @param cwd string | nil
762
758
--- @return boolean
763
759
function View :is_root_folder_visible (cwd )
764
- return cwd ~= " /" and not self .hide_root_folder
760
+ return cwd ~= " /" and self .explorer . opts . renderer . root_folder_label ~= false
765
761
end
766
762
767
763
-- used on ColorScheme event
0 commit comments