about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--browse-slack/environment.mu12
1 files changed, 12 insertions, 0 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu
index 88b389cc..13ef1c36 100644
--- a/browse-slack/environment.mu
+++ b/browse-slack/environment.mu
@@ -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
 }