From 45bf002550843c6c1a6a7ec7427d012713b16fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Wi=C4=99cek?= Date: Thu, 23 Nov 2023 10:43:16 +0100 Subject: [PATCH] fix(help): add guard for too width divider --- ui/widgets/help/widget.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/widgets/help/widget.go b/ui/widgets/help/widget.go index 9d60064..6373c29 100644 --- a/ui/widgets/help/widget.go +++ b/ui/widgets/help/widget.go @@ -89,6 +89,10 @@ func (m Model) View(keyMap help.KeyMap) string { physicalWidth, _, _ := term.GetSize(int(os.Stdout.Fd())) dividerWidth := physicalWidth - lipgloss.Width(helpView) - lipgloss.Width(status) + + if dividerWidth < 0 { + dividerWidth = 0 + } divider := strings.Repeat(" ", dividerWidth) return lipgloss.JoinHorizontal(