Skip to content

Commit 87641f0

Browse files
committed
fix(formatter): don't add extra lines in bash tool
Since we've removed the extra line protection in output, have to be more careful when we're adding lines.
1 parent e93708d commit 87641f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/opencode/ui/formatter.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ function M._format_bash_tool(output, input, metadata)
410410

411411
if metadata.output or metadata.command or input.command then
412412
local command = input.command or metadata.command or ''
413-
M._format_code(output, vim.split('> ' .. command .. '\n\n' .. (metadata.output or ''), '\n'), 'bash')
413+
local command_output = metadata.output and metadata.output ~= '' and ('\n' .. metadata.output) or ''
414+
M._format_code(output, vim.split('> ' .. command .. '\n' .. command_output, '\n'), 'bash')
414415
end
415416
end
416417

0 commit comments

Comments
 (0)