fix(ui): set current win only when its valid

This commit is contained in:
Folke Lemaitre 2022-12-21 08:33:10 +01:00
parent 3a7b8c8132
commit 3814883aaa
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 4 additions and 1 deletions

View File

@ -60,3 +60,4 @@
- [x] Most emojis in "Configuration" aren't shown for me. - [x] Most emojis in "Configuration" aren't shown for me.
- [x] add section on how to uninstall - [x] add section on how to uninstall
- [x] add `:Packadd` command or something similar - [x] add `:Packadd` command or something similar
- [ ] headless install

View File

@ -81,7 +81,9 @@ function M.show(mode)
vim.api.nvim_create_autocmd("VimEnter", { vim.api.nvim_create_autocmd("VimEnter", {
once = true, once = true,
callback = function() callback = function()
vim.api.nvim_set_current_win(win) if win and vim.api.nvim_win_is_valid(win) then
pcall(vim.api.nvim_set_current_win, win)
end
end, end,
}) })
end end