about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-04 21:46:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-04 21:48:35 -0700
commit7531bc2124b837d5e2ad0185adeb6bf38e39edc4 (patch)
treec406bb2f2c26f615413c80372eb35ce6cd125c7d
parent11e8d83d61c59aa7c4cf6b426664a1d4cd921883 (diff)
downloadmu-7531bc2124b837d5e2ad0185adeb6bf38e39edc4.tar.gz
always render functions starting at the cursor
For now we just never render definitions above it. That will improve.
-rw-r--r--shell/global.mu6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/global.mu b/shell/global.mu
index bd076bb8..6f6f1cb5 100644
--- a/shell/global.mu
+++ b/shell/global.mu
@@ -135,8 +135,8 @@ fn render-globals screen: (addr screen), _self: (addr global-table), show-cursor
     loop
   }
   var lowest-index/edi: int <- copy curr-index
-  var final-index/edx: (addr int) <- get self, final-index
-  var curr-index/edx: int <- copy *final-index
+  var cursor-index/edx: (addr int) <- get self, cursor-index
+  var curr-index/edx: int <- copy *cursor-index
   var y1: int
   copy-to y1, 1/padding-top
   var y2: int
@@ -212,6 +212,8 @@ fn assign-or-create-global _self: (addr global-table), name: (addr array byte),
     var final-index-addr/eax: (addr int) <- get self, final-index
     increment *final-index-addr
     curr-index <- copy *final-index-addr
+    var cursor-index-addr/eax: (addr int) <- get self, cursor-index
+    copy-to *cursor-index-addr, curr-index
   }
   var data-ah/eax: (addr handle array global) <- get self, data
   var data/eax: (addr array global) <- lookup *data-ah