diff options
author | Christian Rocha <christian@rocha.is> | 2020-06-24 11:45:45 -0400 |
---|---|---|
committer | Christian Muehlhaeuser <muesli@gmail.com> | 2020-10-05 13:48:22 +0200 |
commit | 8370f7441ed6a0ce4c41827b1cff63fbbf935b8b (patch) | |
tree | 34e9e249e7fed2910e70c9a1f0cc9d457a81a1ba /ui | |
parent | 1280ed3bbeabf1a239907a5891aaf4f5f192c0c1 (diff) |
Fix a crash when opening pager help in very narrow windows
Diffstat (limited to 'ui')
-rw-r--r-- | ui/pager.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) } |