Skip to content

Commit fdd7d0a

Browse files
committed
fix: use event bufnr
1 parent bd47644 commit fdd7d0a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lua/nvim-tree.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,8 @@ local function setup_autocommands(opts)
407407
create_nvim_tree_autocmd("BufEnter", {
408408
pattern = "NvimTree_*",
409409
callback = function()
410-
vim.schedule(function()
411-
local bufnr = vim.api.nvim_get_current_buf()
412-
vim.api.nvim_buf_call(bufnr, function()
410+
vim.schedule(function(event)
411+
vim.api.nvim_buf_call(event.buf, function()
413412
vim.cmd [[norm! zz]]
414413
end)
415414
end)

0 commit comments

Comments
 (0)