Skip to content

Commit c226eaf

Browse files
authored
fix: bufnr is nil when incomplete setup. (#955)
fixes #947
1 parent da59247 commit c226eaf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/nvim-tree/lib.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ function M.open()
106106
M.set_target_win()
107107

108108
local cwd = vim.fn.getcwd()
109+
if view.View.bufnr == nil then
110+
vim.schedule(function ()
111+
M.open()
112+
end)
113+
return
114+
end
109115
local should_redraw = view.open()
110116

111117
local respect_buf_cwd = vim.g.nvim_tree_respect_buf_cwd or 0

0 commit comments

Comments
 (0)