@@ -11,11 +11,9 @@ local Class = require("nvim-tree.classic")
1111--- @class (exact ) View : Class
1212--- @field live_filter table
1313--- @field side string
14- --- @field float table
1514--- @field private explorer Explorer
1615--- @field private adaptive_size boolean
1716--- @field private centralize_selection boolean
18- --- @field private hide_root_folder boolean
1917--- @field private winopts table
2018--- @field private height integer
2119--- @field private preserve_window_proportions boolean
@@ -40,9 +38,7 @@ function View:new(args)
4038 self .explorer = args .explorer
4139 self .adaptive_size = false
4240 self .centralize_selection = self .explorer .opts .view .centralize_selection
43- self .float = self .explorer .opts .view .float
4441 self .height = self .explorer .opts .view .height
45- self .hide_root_folder = self .explorer .opts .renderer .root_folder_label == false
4642 self .preserve_window_proportions = self .explorer .opts .view .preserve_window_proportions
4743 self .side = (self .explorer .opts .view .side == " right" ) and " right" or " left"
4844 self .live_filter = { prev_focused_node = nil , }
@@ -217,16 +213,16 @@ end
217213--- @private
218214--- @return table
219215function 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 ()
222218 else
223- return self .float .open_win_config
219+ return self .explorer . opts . view . float .open_win_config
224220 end
225221end
226222
227223--- @private
228224function View :open_window ()
229- if self .float .enable then
225+ if self .explorer . opts . view . float .enable then
230226 vim .api .nvim_open_win (0 , true , self :open_win_config ())
231227 else
232228 vim .api .nvim_command (" vsp" )
405401
406402--- @param size string | number | nil
407403function 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
409405 -- 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
411407 return
412408 end
413409
761757--- @param cwd string | nil
762758--- @return boolean
763759function 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
765761end
766762
767763-- used on ColorScheme event
0 commit comments