Skip to content

Commit 0e4ad68

Browse files
committed
fix(ui): preserve block content formatting when parsing chat messages
Remove trimming of block content when parsing chat messages to ensure that formatting, such as leading and trailing whitespace, is preserved. This prevents unintended loss of formatting in code or text blocks within chat sections.
1 parent b3d675e commit 0e4ad68

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/CopilotChat/ui/chat.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ function Chat:parse()
734734
message.content = vim.trim(table.concat(message.content, '\n'))
735735
if message.section then
736736
for _, block in ipairs(message.section.blocks) do
737-
block.content = vim.trim(table.concat(block.content, '\n'))
737+
block.content = table.concat(block.content, '\n')
738738
end
739739
end
740740

0 commit comments

Comments
 (0)