scrolling bounds checks

This commit is contained in:
Felix Angell 2018-04-15 19:23:35 +01:00
parent 7c4706356b
commit 112cdc74d6

View File

@ -370,6 +370,7 @@ func (b *Buffer) scrollUp() {
}
func (b *Buffer) scrollDown() {
if b.cam.y < len(b.contents) {
// TODO move the cursor down 45 lines
// IF the buffer exceeds the window size.
lineScrollAmount := 10
@ -379,6 +380,7 @@ func (b *Buffer) scrollDown() {
b.moveDown()
}
}
}
// processes a key press. returns if there
// was a key that MODIFIED the buffer.