fix: put resize before preview ends
This commit is contained in:
@@ -250,6 +250,8 @@ function M.open_file(mode, filename)
|
|||||||
ecmd()
|
ecmd()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
view.resize()
|
||||||
|
|
||||||
if mode == 'preview' then
|
if mode == 'preview' then
|
||||||
if not found then M.set_target_win() end
|
if not found then M.set_target_win() end
|
||||||
view.focus()
|
view.focus()
|
||||||
@@ -264,8 +266,6 @@ function M.open_file(mode, filename)
|
|||||||
view.close()
|
view.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
view.resize()
|
|
||||||
|
|
||||||
renderer.draw(M.Tree, true)
|
renderer.draw(M.Tree, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ function M.setup()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(M.View.bufopts) do
|
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
|
end
|
||||||
|
|
||||||
if vim.g.nvim_tree_disable_keybindings ~= 1 then
|
if vim.g.nvim_tree_disable_keybindings ~= 1 then
|
||||||
@@ -205,7 +205,7 @@ function M.open()
|
|||||||
local winnr = a.nvim_get_current_win()
|
local winnr = a.nvim_get_current_win()
|
||||||
M.View.tabpages[a.nvim_get_current_tabpage()] = winnr
|
M.View.tabpages[a.nvim_get_current_tabpage()] = winnr
|
||||||
for k, v in pairs(M.View.winopts) do
|
for k, v in pairs(M.View.winopts) do
|
||||||
a.nvim_win_set_option(winnr, k, v)
|
vim.wo[winnr][k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd("buffer "..M.View.bufnr)
|
vim.cmd("buffer "..M.View.bufnr)
|
||||||
|
|||||||
Reference in New Issue
Block a user