From daa0624e508e7e61ad80dc1f80fd705a6e141359 Mon Sep 17 00:00:00 2001 From: Peter Cardenas <16930781+PeterCardenas@users.noreply.github.com> Date: Thu, 8 May 2025 22:47:01 -0700 Subject: [PATCH] fix: handle error when no file selector window exists when no files (#2021) --- lua/avante/sidebar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 72b4029..292bc67 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -2830,7 +2830,7 @@ function Sidebar:create_selected_files_container() local selected_filepaths_ = self.file_selector:get_selected_filepaths() if #selected_filepaths_ == 0 then - if self.selected_files_container and api.nvim_win_is_valid(self.selected_files_container.winid) then + if Utils.is_valid_container(self.selected_files_container) then self.selected_files_container:unmount() self:refresh_winids() end