Prevent from scrolling past the end of the content

Fixes issue #31
pull/34/head
Georgi Dimitrov 7 years ago
parent 93f2941a93
commit 05bb54a51b

@ -781,6 +781,10 @@ func scrollView(v *gocui.View, dy int) error {
if oy+dy < 0 {
dy = -oy
}
_, err = v.Line(dy)
if dy > 0 && err != nil {
dy = 0
}
v.SetOrigin(ox, oy+dy)
return nil
}

Loading…
Cancel
Save