about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-20 22:41:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-20 23:07:23 -0700
commit9ae724e1ec928df0183285a006452bffdca7c014 (patch)
tree638614b8a17b6f9753984ad3870080a795fafc50
parent7045af7a4e37ebc516299eda83e755423f31d7eb (diff)
downloadmu-9ae724e1ec928df0183285a006452bffdca7c014.tar.gz
preserve indentation of the sandbox
-rw-r--r--shell/data.limg2
-rw-r--r--shell/environment.mu8
-rw-r--r--shell/sandbox.mu4
3 files changed, 7 insertions, 7 deletions
diff --git a/shell/data.limg b/shell/data.limg
index 825e03ba..1f9ecee2 100644
--- a/shell/data.limg
+++ b/shell/data.limg
@@ -192,5 +192,5 @@
     (main . [def (main screen keyboard)
   (pat screen)])
   ))
-  (sandbox . (pat screen))
+  (sandbox . [(pat screen)])
 )
diff --git a/shell/environment.mu b/shell/environment.mu
index af4f1529..48b9babe 100644
--- a/shell/environment.mu
+++ b/shell/environment.mu
@@ -998,14 +998,14 @@ fn load-state _self: (addr environment), data-disk: (addr disk) {
   {
     compare sandbox-cell, 0
     break-if-=
-    # print: cell -> stream
-    clear-trace trace
-    print-cell sandbox-cell-ah, s, trace
+    var sandbox-data-ah/eax: (addr handle stream byte) <- get sandbox-cell, text-data
+    var _sandbox-data/eax: (addr stream byte) <- lookup *sandbox-data-ah
+    var sandbox-data/ecx: (addr stream byte) <- copy _sandbox-data
     # stream -> gap-buffer
     var sandbox/eax: (addr sandbox) <- get self, sandbox
     var data-ah/eax: (addr handle gap-buffer) <- get sandbox, data
     var data/eax: (addr gap-buffer) <- lookup *data-ah
-    load-gap-buffer-from-stream data, s
+    load-gap-buffer-from-stream data, sandbox-data
   }
 }
 
diff --git a/shell/sandbox.mu b/shell/sandbox.mu
index 39173f99..d4926bff 100644
--- a/shell/sandbox.mu
+++ b/shell/sandbox.mu
@@ -71,9 +71,9 @@ fn write-sandbox out: (addr stream byte), _self: (addr sandbox) {
     break-if-!=
     return
   }
-  write out, "  (sandbox . "
+  write out, "  (sandbox . ["
   append-gap-buffer data, out
-  write out, ")\n"
+  write out, "])\n"
 }
 
 ##