formatMultilineError formats a plain error message, indenting any newlines so that continuation lines are visually subordinate to the leading "✗" prefix.
(msg string)
| 363 | // formatMultilineError formats a plain error message, indenting any newlines so that |
| 364 | // continuation lines are visually subordinate to the leading "✗" prefix. |
| 365 | func formatMultilineError(msg string) string { |
| 366 | if !strings.Contains(msg, "\n") { |
| 367 | return FormatErrorMessage(msg) |
| 368 | } |
| 369 | lines := strings.Split(msg, "\n") |
| 370 | var sb strings.Builder |
| 371 | sb.WriteString(applyStyle(styles.Error, "✗ ")) |
| 372 | sb.WriteString(lines[0]) |
| 373 | for _, line := range lines[1:] { |
| 374 | if line != "" { |
| 375 | sb.WriteString("\n ") |
| 376 | sb.WriteString(line) |
| 377 | } |
| 378 | } |
| 379 | return sb.String() |
| 380 | } |
| 381 | |
| 382 | // FormatSectionHeader formats a section header with proper styling |
| 383 | func FormatSectionHeader(header string) string { |
no test coverage detected