fix(bonfire): keep a blank line printed during a live view (IN-11, quick-261028-rqd)

This commit is contained in:
Jakub Zych
2026-10-28 20:34:35 +01:00
parent 795c4f6b29
commit 4d75695582
3 changed files with 41 additions and 1 deletions

View File

@@ -539,8 +539,15 @@ func printAbove(owner *console, s string) bool {
return false
default:
}
block := strings.TrimSuffix(s, "\n")
if block == "" && s != "" {
// A blank line (Println()): bubbletea v2.1.0's insertAbove
// returns early for an empty string, which would drop it, so
// send a single space, which prints as a blank line.
block = " "
}
// One message for the whole block, sent while holding liveMu: blocks
// from different goroutines keep the order of their calls.
v.prog.Send(printLine(strings.TrimSuffix(s, "\n")))
v.prog.Send(printLine(block))
return true
}