mirror of
https://github.com/felixangell/phi.git
synced 2024-08-16 11:10:37 +03:00
scrolling bounds checks
This commit is contained in:
parent
7c4706356b
commit
112cdc74d6
@ -370,13 +370,15 @@ func (b *Buffer) scrollUp() {
|
||||
}
|
||||
|
||||
func (b *Buffer) scrollDown() {
|
||||
// TODO move the cursor down 45 lines
|
||||
// IF the buffer exceeds the window size.
|
||||
lineScrollAmount := 10
|
||||
if b.cam.y < len(b.contents) {
|
||||
// TODO move the cursor down 45 lines
|
||||
// IF the buffer exceeds the window size.
|
||||
lineScrollAmount := 10
|
||||
|
||||
b.cam.y += lineScrollAmount
|
||||
for i := 0; i < lineScrollAmount; i++ {
|
||||
b.moveDown()
|
||||
b.cam.y += lineScrollAmount
|
||||
for i := 0; i < lineScrollAmount; i++ {
|
||||
b.moveDown()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user