fix: put resize before preview ends

This commit is contained in:
kiyan
2021-04-19 23:59:37 +02:00
parent f275d3faae
commit c995d65b7d
2 changed files with 4 additions and 4 deletions

View File

@@ -250,6 +250,8 @@ function M.open_file(mode, filename)
ecmd()
end
view.resize()
if mode == 'preview' then
if not found then M.set_target_win() end
view.focus()
@@ -264,8 +266,6 @@ function M.open_file(mode, filename)
view.close()
end
view.resize()
renderer.draw(M.Tree, true)
end

View File

@@ -113,7 +113,7 @@ function M.setup()
end
for k, v in pairs(M.View.bufopts) do
a.nvim_buf_set_option(M.View.bufnr, k, v)
vim.bo[M.View.bufnr][k] = v
end
if vim.g.nvim_tree_disable_keybindings ~= 1 then
@@ -205,7 +205,7 @@ function M.open()
local winnr = a.nvim_get_current_win()
M.View.tabpages[a.nvim_get_current_tabpage()] = winnr
for k, v in pairs(M.View.winopts) do
a.nvim_win_set_option(winnr, k, v)
vim.wo[winnr][k] = v
end
vim.cmd("buffer "..M.View.bufnr)