summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorChristian Rocha <christian@rocha.is>2020-06-24 11:45:45 -0400
committerChristian Muehlhaeuser <muesli@gmail.com>2020-10-05 13:48:22 +0200
commit8370f7441ed6a0ce4c41827b1cff63fbbf935b8b (patch)
tree34e9e249e7fed2910e70c9a1f0cc9d457a81a1ba /ui
parent1280ed3bbeabf1a239907a5891aaf4f5f192c0c1 (diff)
Fix a crash when opening pager help in very narrow windows
Diffstat (limited to 'ui')
-rw-r--r--ui/pager.go2
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)
}