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 goto continue
end end
local selected_filepaths = entry.selected_filepaths 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( local prefix = render_chat_record_prefix(
entry.timestamp, entry.timestamp,
entry.provider, entry.provider,
entry.model, entry.model,
entry.request or "", entry.request or "",
selected_filepaths, selected_filepaths or {},
entry.selected_code entry.selected_code
) )
content = content .. prefix content = content .. prefix