From 7ecce3fb97420ba2a44e3453c9291a98d5894d9d Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Thu, 20 Jan 2022 11:33:47 -0500 Subject: [PATCH] Ignore width/height settings in viewport's style settings The Lip Gloss width and height settings compete with the main width/height settings and can result in funny rendering and generally cause confusion. --- viewport/viewport.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/viewport/viewport.go b/viewport/viewport.go index be6f2f3..fd77300 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -358,7 +358,10 @@ func (m Model) View() string { extraLines = strings.Repeat("\n", max(0, m.Height-len(lines))) } - return m.Style.Render(strings.Join(lines, "\n") + extraLines) + return m.Style.Copy(). + UnsetWidth(). + UnsetHeight(). + Render(strings.Join(lines, "\n") + extraLines) } func clamp(v, low, high int) int {