fix: check if renderer is nil (closes #63) (#64)

This commit is contained in:
yetone 2024-08-18 17:54:57 +08:00 committed by GitHub
parent c8a764b3a1
commit 1f1aed36bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,9 +84,13 @@ function Sidebar:open()
end end
function Sidebar:close() function Sidebar:close()
if self.renderer ~= nil then
self.renderer:close() self.renderer:close()
end
if self.code ~= nil and api.nvim_win_is_valid(self.code.win) then
fn.win_gotoid(self.code.win) fn.win_gotoid(self.code.win)
end end
end
---@return boolean ---@return boolean
function Sidebar:focus() function Sidebar:focus()