Skip to content

Commit

Permalink
Prevent from scrolling past the end of the content
Browse files Browse the repository at this point in the history
Fixes issue asciimoo#31
  • Loading branch information
Georgi Dimitrov committed Feb 7, 2017
1 parent 93f2941 commit 05bb54a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 05bb54a

Please sign in to comment.