Skip to content

Commit b2dc803

Browse files
committed
refactor(#2731): resolve warnings
1 parent f2ecd83 commit b2dc803

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/nvim-tree/renderer/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ function M.draw()
5151

5252
local profile = log.profile_start "draw"
5353

54-
local cursor = vim.api.nvim_win_get_cursor(view.get_winnr())
54+
local cursor = vim.api.nvim_win_get_cursor(view.get_winnr() or 0)
5555
icon_component.reset_config()
5656

5757
local builder = Builder:new():build()
5858

5959
_draw(bufnr, builder.lines, builder.hl_args, builder.signs)
6060

6161
if cursor and #builder.lines >= cursor[1] then
62-
vim.api.nvim_win_set_cursor(view.get_winnr(), cursor)
62+
vim.api.nvim_win_set_cursor(view.get_winnr() or 0, cursor)
6363
end
6464

6565
view.grow_from_content()

0 commit comments

Comments
 (0)