Skip to content

Commit 8625b2f

Browse files
committed
fix(formatter): fallback to file.patch when diff missing
1 parent 06c709a commit 8625b2f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lua/opencode/ui/formatter/tools/apply_patch.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ function M.format(output, part)
3636
file.relativePath or file.filePath,
3737
formatter_utils.get_duration_text(part)
3838
)
39-
if config.ui.output.tools.show_output and file.diff then
39+
40+
local patch = file.diff or file.patch
41+
if config.ui.output.tools.show_output and patch then
4042
local file_type = file and util.get_markdown_filetype(file.filePath) or ''
41-
formatter_utils.format_diff(output, file.diff, file_type)
43+
formatter_utils.format_diff(output, patch, file_type)
4244
end
4345
end
4446
end

0 commit comments

Comments
 (0)