Skip to content

Commit

Permalink
fix: seleted file is nil (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone authored Jan 7, 2025
1 parent 6ebba15 commit a3ac0b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/avante/sidebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1326,13 +1326,15 @@ function Sidebar:render_history_content(history)
goto continue
end
local selected_filepaths = entry.selected_filepaths
if not selected_filepaths then selected_filepaths = { entry.selected_file.filepath } end
if not selected_filepaths and entry.selected_file ~= nil then
selected_filepaths = { entry.selected_file.filepath }
end
local prefix = render_chat_record_prefix(
entry.timestamp,
entry.provider,
entry.model,
entry.request or "",
selected_filepaths,
selected_filepaths or {},
entry.selected_code
)
content = content .. prefix
Expand Down

0 comments on commit a3ac0b8

Please sign in to comment.