about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-20 13:39:31 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-20 13:39:31 -0700
commitcbe90c6a2b06747f91de0e508982813ce6604137 (patch)
treeafab77f9400adea442cdb02e03444390f14091f5
parent38ff55045521392e060a28db0bcb44fb46c28771 (diff)
downloadmu-cbe90c6a2b06747f91de0e508982813ce6604137.tar.gz
7084
Cursor now updating right.

Still a couple of bugs:
  ctrl-e doesn't know about multiple lines
  function calls don't expand right in multi-line sandboxes
    (but at least I'm now getting to see them in action!)
-rw-r--r--apps/tile/environment.mu9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu
index 80b749ff..23c2d243 100644
--- a/apps/tile/environment.mu
+++ b/apps/tile/environment.mu
@@ -590,8 +590,8 @@ $process-sandbox-define:body: {
     allocate body-ah
     var body/eax: (addr line) <- lookup *body-ah
     var body-contents/ecx: (addr handle word) <- get body, data
-    var final-line: (handle line)
-    var final-line-ah/eax: (addr handle line) <- address final-line
+    var final-line-storage: (handle line)
+    var final-line-ah/eax: (addr handle line) <- address final-line-storage
     final-line sandbox, final-line-ah
     var final-line/eax: (addr line) <- lookup *final-line-ah
     var final-line-contents/eax: (addr handle word) <- get final-line, data
@@ -605,6 +605,11 @@ $process-sandbox-define:body: {
     # clear partial-name-for-function
     var empty-word: (handle word)
     copy-handle empty-word, new-name-ah
+    # update cursor
+    var final-line/eax: (addr line) <- lookup final-line-storage
+    var cursor-call-path-ah/ecx: (addr handle call-path-element) <- get sandbox, cursor-call-path
+    allocate cursor-call-path-ah  # leak
+    initialize-path-from-line final-line, cursor-call-path-ah
     break $process-sandbox-define:body
   }
   #