fix(ui): check if win is still valid

This commit is contained in:
Folke Lemaitre 2023-01-03 09:13:11 +01:00
parent b5f4106892
commit e749e68b68
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ function M.show(mode)
return
end
M.view = (M.view and M.view.win) and M.view or M.create()
M.view = (M.view and M.view.win and vim.api.nvim_win_is_valid(M.view.win)) and M.view or M.create()
if mode then
M.view.state.mode = mode
end