hackily handle overly large posts

We don't have pagination within a single post yet.
This commit is contained in:
Kartik K. Agaram 2021-08-11 21:50:14 -07:00
parent 91ae7ff9ba
commit 9c25023a20
1 changed files with 12 additions and 0 deletions

View File

@ -214,6 +214,18 @@ fn page-down _env: (addr environment), _items: (addr item-list) {
}
new-item-index <- increment
var dest/eax: (addr int) <- get env, item-index
{
# HACK: make sure we make forward progress even if a single post takes up
# the whole screen.
# We can't see the rest of that single post at the moment. But at least we
# can go past it.
compare new-item-index, *dest
break-if-!=
# Don't make "forward progress" past post 0.
compare new-item-index, 0
break-if-=
new-item-index <- decrement
}
copy-to *dest, new-item-index
}