tui: add contentStyle, applied to overall viewport content

This commit is contained in:
Matt Low 2024-03-13 05:32:16 +00:00
parent 6ce42a77f9
commit 0ab552303d
1 changed files with 4 additions and 1 deletions

View File

@ -78,6 +78,9 @@ var (
headerStyle = lipgloss.NewStyle().
PaddingLeft(1).
Background(lipgloss.Color("0"))
contentStyle = lipgloss.NewStyle().
PaddingTop(1).
PaddingBottom(1)
footerStyle = lipgloss.NewStyle().
Faint(true).
BorderTop(true).
@ -340,7 +343,7 @@ func (m *model) updateContent() {
}
}
atBottom := m.content.AtBottom()
m.content.SetContent(sb.String())
m.content.SetContent(contentStyle.Render(sb.String()))
if atBottom {
// if we were at bottom before the update, scroll with the output
m.content.GotoBottom()