Merge branch 'master' into add-pre-events
This commit is contained in:
commit
a68a114439
@ -236,6 +236,17 @@ local function setup_autocommands(opts)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Handles event dispatch when tree is closed by `:q`
|
||||
create_nvim_tree_autocmd("WinClosed", {
|
||||
pattern = "*",
|
||||
---@param ev vim.api.keyset.create_autocmd.callback_args
|
||||
callback = function(ev)
|
||||
if vim.api.nvim_get_option_value("filetype", { buf = ev.buf }) == "NvimTree" then
|
||||
require("nvim-tree.events")._dispatch_on_tree_close()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
|
||||
|
||||
@ -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
|
||||
@ -131,7 +130,6 @@ function M.open(opts)
|
||||
open_view_and_draw()
|
||||
end
|
||||
view.restore_tab_state()
|
||||
events._dispatch_on_tree_open()
|
||||
end
|
||||
|
||||
function M.setup(opts)
|
||||
|
||||
@ -255,7 +255,6 @@ local function close(tabpage)
|
||||
return
|
||||
end
|
||||
end
|
||||
events._dispatch_on_tree_close()
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -427,6 +426,7 @@ function M.open_in_win(opts)
|
||||
M.reposition_window()
|
||||
M.resize()
|
||||
end
|
||||
events._dispatch_on_tree_open()
|
||||
end
|
||||
|
||||
function M.abandon_current_window()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user