File tree 4 files changed +3
-14
lines changed
4 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -2781,13 +2781,9 @@ e.g. handler for node renamed: >lua
2781
2781
Invoked after the NvimTree is opened.
2782
2782
• Note: Handler takes no parameter.
2783
2783
2784
- - Event.TreePreClose
2785
- Invoked before the window and buffer for NvimTree are closed.
2786
- Before | Event.TreeClose | event.
2787
- • Note: Handler takes no parameter.
2788
-
2789
2784
- Event.TreeClose
2790
- Invoked after the NvimTree is closed.
2785
+ Invoked after the NvimTree is closed, but before the window is
2786
+ closed. Dispatched on | WinClosed | event for NvimTree window.
2791
2787
• Note: Handler takes no parameter.
2792
2788
2793
2789
- Event.Resize - When NvimTree is resized.
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ M.Event = {
10
10
NodeRenamed = " NodeRenamed" ,
11
11
TreePreOpen = " TreePreOpen" ,
12
12
TreeOpen = " TreeOpen" ,
13
- TreePreClose = " TreePreClose" ,
14
13
TreeClose = " TreeClose" ,
15
14
WillCreateFile = " WillCreateFile" ,
16
15
FileCreated = " FileCreated" ,
@@ -103,11 +102,6 @@ function M._dispatch_on_tree_open()
103
102
dispatch (M .Event .TreeOpen , nil )
104
103
end
105
104
106
- -- @private
107
- function M ._dispatch_on_tree_pre_close ()
108
- dispatch (M .Event .TreePreClose , nil )
109
- end
110
-
111
105
-- @private
112
106
function M ._dispatch_on_tree_close ()
113
107
dispatch (M .Event .TreeClose , nil )
Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ function M.open(opts)
109
109
110
110
local explorer = core .get_explorer ()
111
111
112
- events ._dispatch_on_tree_pre_open ()
113
112
if should_hijack_current_buf () then
114
113
view .close_this_tab_only ()
115
114
view .open_in_win ()
Original file line number Diff line number Diff line change @@ -238,7 +238,6 @@ local function close(tabpage)
238
238
return
239
239
end
240
240
save_tab_state (tabpage )
241
- events ._dispatch_on_tree_pre_close ()
242
241
switch_buf_if_last_buf ()
243
242
local tree_win = M .get_winnr (tabpage )
244
243
local current_win = vim .api .nvim_get_current_win ()
415
414
--- @param opts OpenInWinOpts | nil
416
415
function M .open_in_win (opts )
417
416
opts = opts or { hijack_current_buf = true , resize = true }
417
+ events ._dispatch_on_tree_pre_open ()
418
418
if opts .winid and vim .api .nvim_win_is_valid (opts .winid ) then
419
419
vim .api .nvim_set_current_win (opts .winid )
420
420
end
You can’t perform that action at this time.
0 commit comments