fix: when initialize the avante, dont mark the current buffer as selected if it's a directory path (#2254)

This commit is contained in:
guanghechen
2025-06-18 13:35:37 +08:00
committed by GitHub
parent 07319d1bd6
commit c356fc7ce1

View File

@@ -1436,7 +1436,9 @@ function Sidebar:initialize()
Utils.debug("Sidebar:initialize adding buffer to file selector", buf_path)
self.file_selector:reset()
self.file_selector:add_selected_file(filepath)
local stat = vim.uv.fs_stat(filepath)
if stat == nil or stat.type == "file" then self.file_selector:add_selected_file(filepath) end
self:reload_chat_history()