Skip to content

Commit

Permalink
Improve out format
Browse files Browse the repository at this point in the history
  • Loading branch information
luozhiya committed May 18, 2024
1 parent de1b82b commit d5671a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/fittencode/engines/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ local function chain_actions(action, solved_prefix, on_error)
else
elapsed_time = elapsed_time + ms
depth = depth + 1
chat:commit(lines)
chat:commit(lines, true)
local new_solved_prefix = prompt.prefix .. table.concat(lines, '\n') .. '\n'
chain_actions(action, new_solved_prefix, on_error)
end
Expand Down
2 changes: 1 addition & 1 deletion lua/fittencode/views/chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function M:commit(text, linebreak)
return
end
if linebreak and #self.text > 0 and #lines > 0 then
if lines[1] ~= '' and not string.match(lines[1], '^```') and self.text[#self.text] ~= '' and not string.match(self.text[#self.text], '^```') then
if lines[1] ~= '' and self.text[#self.text] ~= '' then
table.insert(lines, 1, '')
end
end
Expand Down

0 comments on commit d5671a5

Please sign in to comment.