Skip to content

Commit bd47644

Browse files
committed
fix: use explicit buf inside schedule callback
1 parent 237b90b commit bd47644

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/nvim-tree.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ local function setup_autocommands(opts)
408408
pattern = "NvimTree_*",
409409
callback = function()
410410
vim.schedule(function()
411-
vim.api.nvim_buf_call(0, function()
411+
local bufnr = vim.api.nvim_get_current_buf()
412+
vim.api.nvim_buf_call(bufnr, function()
412413
vim.cmd [[norm! zz]]
413414
end)
414415
end)

0 commit comments

Comments
 (0)