feat: add on_tree_resize event

This commit is contained in:
kiyan
2022-07-06 13:35:29 +02:00
parent eb6dde4733
commit c84735483f
3 changed files with 25 additions and 2 deletions

View File

@@ -244,12 +244,15 @@ function M.resize(size)
return
end
local new_size = get_size()
if M.is_vertical() then
a.nvim_win_set_width(M.get_winnr(), get_size())
a.nvim_win_set_width(M.get_winnr(), new_size)
else
a.nvim_win_set_height(M.get_winnr(), get_size())
a.nvim_win_set_height(M.get_winnr(), new_size)
end
events._dispatch_on_tree_resize(new_size)
if not M.View.preserve_window_proportions then
vim.cmd ":wincmd ="
end