fix(body): preserve indented lines as preformatted

Amolith created

Lines starting with 4+ spaces or a tab are now preserved verbatim,
fixing code block formatting in commit bodies.

Before:

    task.Method1()
    task.Method2()

Would become "task.Method1() task.Method2()" after reflowing.

Assisted-by: Claude Opus 4.5 via Crush

Change summary

wrapBody.go | 6 ++++++
1 file changed, 6 insertions(+)

Detailed changes

wrapBody.go 🔗

@@ -26,6 +26,12 @@ func formatBody(body string) (string, error) {
 	}
 
 	for _, line := range lines {
+		// Preserve indented lines (4+ spaces or tab) as preformatted code
+		if strings.HasPrefix(line, "    ") || strings.HasPrefix(line, "\t") {
+			result = append(result, line)
+			continue
+		}
+
 		trimmed := strings.TrimSpace(line)
 		if trimmed == "" {
 			flushPlainText()