about summary refs log tree commit diff stats
path: root/browse-slack
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-13 14:20:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-13 14:20:58 -0700
commit32993b205b5a11bf4b91ea51e7ceb133815b5b40 (patch)
tree7f28391b430473a665d3d93aac3b95dab712e294 /browse-slack
parent10efa3bf1d8725d17b740f938f021571a6bf6d39 (diff)
downloadmu-32993b205b5a11bf4b91ea51e7ceb133815b5b40.tar.gz
.
Diffstat (limited to 'browse-slack')
-rw-r--r--browse-slack/environment.mu22
1 files changed, 14 insertions, 8 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu
index 4c8fd659..fc0e6be2 100644
--- a/browse-slack/environment.mu
+++ b/browse-slack/environment.mu
@@ -542,14 +542,20 @@ fn previous-item _env: (addr environment), users: (addr array user), channels: (
   var current-tab-index/eax: int <- copy *current-tab-index-a
   var current-tab-offset/eax: (offset tab) <- compute-offset tabs, current-tab-index
   var current-tab/edx: (addr tab) <- index tabs, current-tab-offset
-  var items/esi: (addr item-list) <- copy _items
-  var items-data-first-free-a/ecx: (addr int) <- get items, data-first-free
-  var final-item-index/ecx: int <- copy *items-data-first-free-a
-  final-item-index <- decrement
-  var dest/eax: (addr int) <- get current-tab, item-index
-  compare *dest, final-item-index
-  break-if->=
-  increment *dest
+  var current-tab-type/eax: (addr int) <- get current-tab, type
+  compare *current-tab-type, 0/all-items
+  {
+    break-if-!=
+    var items/esi: (addr item-list) <- copy _items
+    var items-data-first-free-a/ecx: (addr int) <- get items, data-first-free
+    var final-item-index/ecx: int <- copy *items-data-first-free-a
+    final-item-index <- decrement
+    var dest/eax: (addr int) <- get current-tab, item-index
+    compare *dest, final-item-index
+    break-if->=
+    increment *dest
+    return
+  }
 }
 
 fn page-down _env: (addr environment), users: (addr array user), channels: (addr array channel), _items: (addr item-list) {