fix: seleted file is nil (#1049)

This commit is contained in:
yetone 2025-01-07 14:36:31 +08:00 committed by GitHub
parent 6ebba1526b
commit a3ac0b84be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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