diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 452370822..838e3ec61 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -586,7 +586,11 @@ function Sidebar:on_mount() api.nvim_create_autocmd("WinResized", { group = self.augroup, callback = function() - if not api.nvim_win_is_valid(self.input_container.winid) or not api.nvim_win_is_valid(self.input.winid) then + if + not self.input_container.winid + or not api.nvim_win_is_valid(self.input_container.winid) + or not api.nvim_win_is_valid(self.input.winid) + then return end