Skip to content

Commit c356fc7

Browse files
authored
fix: when initialize the avante, dont mark the current buffer as selected if it's a directory path (#2254)
1 parent 07319d1 commit c356fc7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/avante/sidebar.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,9 @@ function Sidebar:initialize()
14361436
Utils.debug("Sidebar:initialize adding buffer to file selector", buf_path)
14371437

14381438
self.file_selector:reset()
1439-
self.file_selector:add_selected_file(filepath)
1439+
1440+
local stat = vim.uv.fs_stat(filepath)
1441+
if stat == nil or stat.type == "file" then self.file_selector:add_selected_file(filepath) end
14401442

14411443
self:reload_chat_history()
14421444

0 commit comments

Comments
 (0)