Skip to content

Commit b6ff587

Browse files
authored
fix(ui): preserve block content formatting when parsing chat messages (#1495)
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 b6ff587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)