Adjust maximum scroll offset

It was possible that a few lines at the bottom may not be visible if
there are lines above that span multiple lines.
This commit is contained in:
Junegunn Choi 2016-10-04 01:39:48 +09:00
parent 01b88539ba
commit 51f532697e
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -1188,7 +1188,7 @@ func (t *Terminal) Loop() {
}
scrollPreview := func(amount int) {
t.previewer.offset = util.Constrain(
t.previewer.offset+amount, 0, t.previewer.lines-t.pwindow.Height)
t.previewer.offset+amount, 0, t.previewer.lines-1)
req(reqPreviewRefresh)
}
for key, ret := range t.expect {