From 50ad7d9ec62d94fced07ebe4aac01f3d3a07420f Mon Sep 17 00:00:00 2001 From: Matt Low Date: Wed, 13 Mar 2024 05:32:16 +0000 Subject: [PATCH] tui: add contentStyle, applied to overall viewport content --- pkg/tui/tui.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/tui/tui.go b/pkg/tui/tui.go index 29d4732..4d2e260 100644 --- a/pkg/tui/tui.go +++ b/pkg/tui/tui.go @@ -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()