fix: don't throw errors when closing code window (#2401)

This commit is contained in:
Dmitry Torokhov
2025-07-02 23:45:35 -07:00
committed by GitHub
parent 9bc5bf8053
commit 8346d9b005

View File

@@ -218,7 +218,9 @@ end
function Sidebar:recover_code_winhl()
if self.code.old_winhl ~= nil then
vim.wo[self.code.winid].winhl = self.code.old_winhl
if self.code.winid and api.nvim_win_is_valid(self.code.winid) then
vim.wo[self.code.winid].winhl = self.code.old_winhl
end
self.code.old_winhl = nil
end
end