about summary refs log tree commit diff stats
path: root/edit
diff options
context:
space:
mode:
Diffstat (limited to 'edit')
-rw-r--r--edit/005-sandbox.mu6
-rw-r--r--edit/008-sandbox-test.mu13
-rw-r--r--edit/010-warnings.mu1
3 files changed, 15 insertions, 5 deletions
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 244c24f6..a5a0d239 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -36,7 +36,6 @@ container sandbox-data [
   # constraint: will be 0 for sandboxes at positions before env.render-from
   starting-row-on-screen:number
   code-ending-row-on-screen:number  # past end of code
-  response-starting-row-on-screen:number
   screen:address:shared:screen  # prints in the sandbox go here
   next-sandbox:address:shared:sandbox-data
 ]
@@ -301,7 +300,6 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
     code-ending-row:address:number <- get-address *sandbox, code-ending-row-on-screen:offset
     *code-ending-row <- copy row
     # render sandbox warnings, screen or response, in that order
-    response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset
     sandbox-response:address:shared:array:character <- get *sandbox, response:offset
     <render-sandbox-results>
     {
@@ -312,7 +310,6 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
     }
     {
       break-unless empty-screen?
-      *response-starting-row <- copy row
       <render-sandbox-response>
       row, screen <- render screen, sandbox-response, left, right, 245/grey, row
     }
@@ -329,8 +326,7 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
     *tmp <- copy 0
     tmp:address:number <- get-address *sandbox, code-ending-row-on-screen:offset
     *tmp <- copy 0
-    tmp:address:number <- get-address *sandbox, response-starting-row-on-screen:offset
-    *tmp <- copy 0
+    <end-render-sandbox-reset-hidden>
   }
   # draw next sandbox
   next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset
diff --git a/edit/008-sandbox-test.mu b/edit/008-sandbox-test.mu
index fb6dc260..347980aa 100644
--- a/edit/008-sandbox-test.mu
+++ b/edit/008-sandbox-test.mu
@@ -111,6 +111,11 @@ after <global-touch> [
   }
 ]
 
+# this requires tracking where responses begin for every sandbox
+container sandbox-data [
+  response-starting-row-on-screen:number
+]
+
 recipe find-click-in-sandbox-output env:address:shared:programming-environment-data, click-row:number -> sandbox:address:shared:sandbox-data [
   local-scope
   load-ingredients
@@ -156,6 +161,8 @@ recipe toggle-expected-response sandbox:address:shared:sandbox-data -> sandbox:a
 after <render-sandbox-response> [
   {
     break-unless sandbox-response
+    response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset
+    *response-starting-row <- copy row
     expected-response:address:shared:array:character <- get *sandbox, expected-response:offset
     break-unless expected-response  # fall-through to print in grey
     response-is-expected?:boolean <- equal expected-response, sandbox-response
@@ -170,3 +177,9 @@ after <render-sandbox-response> [
     jump +render-sandbox-end:label
   }
 ]
+
+before <end-render-sandbox-reset-hidden> [
+  $log sandbox, [resetting response starting row]
+  tmp:address:number <- get-address *sandbox, response-starting-row-on-screen:offset
+  *tmp <- copy 0
+]
diff --git a/edit/010-warnings.mu b/edit/010-warnings.mu
index 5220ad3e..8771a869 100644
--- a/edit/010-warnings.mu
+++ b/edit/010-warnings.mu
@@ -117,6 +117,7 @@ after <render-sandbox-trace-done> [
   {
     sandbox-warnings:address:shared:array:character <- get *sandbox, warnings:offset
     break-unless sandbox-warnings
+    response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset
     *response-starting-row <- copy 0  # no response
     row, screen <- render screen, sandbox-warnings, left, right, 1/red, row
     # don't try to print anything more for this sandbox