feat - add open and close tree events (#1151)

This commit is contained in:
Harry Prior
2022-04-18 14:41:21 +01:00
committed by GitHub
parent ff6ef58b03
commit cff5a106b2
3 changed files with 44 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ local a = vim.api
local M = {}
local events = require "nvim-tree.events"
M.View = {
tabpages = {},
hide_root_folder = false,
@@ -173,6 +175,7 @@ function M.close()
if tree_win == current_win and LAST_FOCUSED_WIN then
a.nvim_set_current_win(LAST_FOCUSED_WIN)
end
events._dispatch_on_tree_close()
return
end
end
@@ -193,6 +196,7 @@ function M.open(options)
if not opts.focus_tree then
vim.cmd "wincmd p"
end
events._dispatch_on_tree_open()
end
function M.resize(size)