feat: add TreePreOpen event (#3105)

* feat: Add `TreePreOpen` and `TreePreClose` events

* docs: Update docs for `TreePreOpen` and `TreePreClose` events

* chore: remove `TreePreClose` event and update dispatch of `TreePreOpen`

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Devansh Sharma
2025-04-21 04:09:48 +05:30
committed by GitHub
parent 3a63717d3d
commit c24c0470d9
3 changed files with 17 additions and 1 deletions

View File

@@ -288,6 +288,7 @@ function M.open(options)
local profile = log.profile_start("view open")
events._dispatch_on_tree_pre_open()
create_buffer()
open_window()
M.resize()
@@ -413,6 +414,7 @@ end
---@param opts OpenInWinOpts|nil
function M.open_in_win(opts)
opts = opts or { hijack_current_buf = true, resize = true }
events._dispatch_on_tree_pre_open()
if opts.winid and vim.api.nvim_win_is_valid(opts.winid) then
vim.api.nvim_set_current_win(opts.winid)
end