From 8370f7441ed6a0ce4c41827b1cff63fbbf935b8b Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 24 Jun 2020 11:45:45 -0400 Subject: [PATCH] Fix a crash when opening pager help in very narrow windows --- ui/pager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pager.go b/ui/pager.go index 7ed50cc..d780660 100644 --- a/ui/pager.go +++ b/ui/pager.go @@ -310,7 +310,7 @@ func pagerHelpView(width int) (s string) { lines := strings.Split(s, "\n") for i := 0; i < len(lines); i++ { l := runewidth.StringWidth(lines[i]) - n := width - l + n := max(width-l, 0) lines[i] += strings.Repeat(" ", n) }