fix(ui): embed vertical padding as content to fix background banding

Lipgloss PaddingTop/PaddingBottom adds raw newlines that don't receive
background color styling. Prepend/append newlines to the content string
instead so they are part of the styled content and get the background.
This commit is contained in:
Ed Zynda
2026-02-26 12:57:22 +03:00
parent 711aefba5e
commit d818eddecb
+10 -2
View File
@@ -146,10 +146,18 @@ func renderContentBlock(content string, containerWidth int, options ...rendering
option(renderer)
}
// Embed vertical padding as content newlines rather than style
// PaddingTop/PaddingBottom — lipgloss adds those as raw newlines
// that don't receive the background color, causing visible banding.
for range renderer.paddingTop {
content = "\n" + content
}
for range renderer.paddingBottom {
content = content + "\n"
}
theme := GetTheme()
style := lipgloss.NewStyle().
PaddingTop(renderer.paddingTop).
PaddingBottom(renderer.paddingBottom).
PaddingLeft(renderer.paddingLeft).
PaddingRight(renderer.paddingRight).
Foreground(theme.Text)