Fix a crash when opening pager help in very narrow windows

This commit is contained in:
Christian Rocha 2020-06-24 11:45:45 -04:00 committed by Christian Muehlhaeuser
commit 8370f7441e

View file

@ -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)
}