fix: reliably dispatch exactly one TreeOpen and TreeClose events (#3107)

* fix: correctly handle `TreeOpen` and `TreeClose` event dispatch

* fix: lint issues
This commit is contained in:
Devansh Sharma
2025-04-20 05:19:28 +05:30
committed by GitHub
parent 5bea2b3752
commit 3a63717d3d
3 changed files with 12 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
local view = require("nvim-tree.view")
local core = require("nvim-tree.core")
local events = require("nvim-tree.events")
local notify = require("nvim-tree.notify")
---@class LibOpenOpts
@@ -130,7 +129,6 @@ function M.open(opts)
open_view_and_draw()
end
view.restore_tab_state()
events._dispatch_on_tree_open()
end
function M.setup(opts)

View File

@@ -254,7 +254,6 @@ local function close(tabpage)
return
end
end
events._dispatch_on_tree_close()
return
end
end
@@ -425,6 +424,7 @@ function M.open_in_win(opts)
M.reposition_window()
M.resize()
end
events._dispatch_on_tree_open()
end
function M.abandon_current_window()