about summary refs log tree commit diff stats
path: root/html/edit
diff options
context:
space:
mode:
Diffstat (limited to 'html/edit')
-rw-r--r--html/edit/003-shortcuts.mu.html81
-rw-r--r--html/edit/005-sandbox.mu.html57
-rw-r--r--html/edit/006-sandbox-edit.mu.html8
-rw-r--r--html/edit/007-sandbox-delete.mu.html16
-rw-r--r--html/edit/008-sandbox-test.mu.html29
-rw-r--r--html/edit/010-warnings.mu.html20
6 files changed, 146 insertions, 65 deletions
diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html
index 243635b0..d47c0614 100644
--- a/html/edit/003-shortcuts.mu.html
+++ b/html/edit/003-shortcuts.mu.html
@@ -201,7 +201,18 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[switching to previous line]</span>
     d:address:shared:duplex-list:character<span class="Special"> &lt;- </span>get *editor, <span class="Constant">data:offset</span>
     end-of-line:number<span class="Special"> &lt;- </span>previous-line-length before-cursor, d
-    *cursor-column<span class="Special"> &lt;- </span>add left, end-of-line
+    right:number<span class="Special"> &lt;- </span>get *editor, <span class="Constant">right:offset</span>
+    width:number<span class="Special"> &lt;- </span>subtract right, left
+    wrap?:boolean<span class="Special"> &lt;- </span>greater-than end-of-line, width
+    <span class="Delimiter">{</span>
+      <span class="muControl">break-unless</span> wrap?
+      _, column-offset:number<span class="Special"> &lt;- </span>divide-with-remainder end-of-line, width
+      *cursor-column<span class="Special"> &lt;- </span>add left, column-offset
+    <span class="Delimiter">}</span>
+    <span class="Delimiter">{</span>
+      <span class="muControl">break-if</span> wrap?
+      *cursor-column<span class="Special"> &lt;- </span>add left, end-of-line
+    <span class="Delimiter">}</span>
     <span class="muControl">reply</span>
   <span class="Delimiter">}</span>
   <span class="Comment"># case 2: if previous-character was not newline, we're just at a wrapped line</span>
@@ -836,7 +847,7 @@ d]
 
 <span class="muScenario">scenario</span> editor-moves-across-screen-lines-across-wrap-with-left-arrow [
   assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span>
-  <span class="Comment"># initialize editor with text containing an empty line</span>
+  <span class="Comment"># initialize editor with a wrapping line</span>
   <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[abcdef]</span>
   <span class="Constant">2</span>:address:shared:editor-data<span class="Special"> &lt;- </span>new-editor <span class="Constant">1</span>:address:shared:array:character, screen:address:shared:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span>
   editor-render screen, <span class="Constant">2</span>:address:shared:editor-data
@@ -860,7 +871,71 @@ d]
   ]
   memory-should-contain [
     <span class="Constant">3</span><span class="Special"> &lt;- </span><span class="Constant">1</span>  <span class="Comment"># previous row</span>
-    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">3</span>  <span class="Comment"># end of wrapped line</span>
+    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">3</span>  <span class="Comment"># right margin except wrap icon</span>
+  ]
+  check-trace-count-for-label <span class="Constant">0</span>, <span class="Constant">[print-character]</span>
+]
+
+<span class="muScenario">scenario</span> editor-moves-across-screen-lines-to-wrapping-line-with-left-arrow [
+  assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span>
+  <span class="Comment"># initialize editor with a wrapping line followed by a second line</span>
+  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[abcdef</span>
+<span class="Constant">g]</span>
+  <span class="Constant">2</span>:address:shared:editor-data<span class="Special"> &lt;- </span>new-editor <span class="Constant">1</span>:address:shared:array:character, screen:address:shared:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span>
+  editor-render screen, <span class="Constant">2</span>:address:shared:editor-data
+<span class="Constant">  $clear-trace</span>
+  screen-should-contain [
+   <span class="Constant"> .          .</span>
+   <span class="Constant"> .abcd↩     .</span>
+   <span class="Constant"> .ef        .</span>
+   <span class="Constant"> .g         .</span>
+   <span class="Constant"> .┈┈┈┈┈     .</span>
+  ]
+  <span class="Comment"># position cursor right after empty line</span>
+  assume-console [
+    left-click <span class="Constant">3</span>, <span class="Constant">0</span>
+    press left-arrow
+  ]
+  run [
+    editor-event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">2</span>:address:shared:editor-data
+    <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>get *<span class="Constant">2</span>:address:shared:editor-data, <span class="Constant">cursor-row:offset</span>
+    <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>get *<span class="Constant">2</span>:address:shared:editor-data, <span class="Constant">cursor-column:offset</span>
+  ]
+  memory-should-contain [
+    <span class="Constant">3</span><span class="Special"> &lt;- </span><span class="Constant">2</span>  <span class="Comment"># previous row</span>
+    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">2</span>  <span class="Comment"># end of wrapped line</span>
+  ]
+  check-trace-count-for-label <span class="Constant">0</span>, <span class="Constant">[print-character]</span>
+]
+
+<span class="muScenario">scenario</span> editor-moves-across-screen-lines-to-non-wrapping-line-with-left-arrow [
+  assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span>
+  <span class="Comment"># initialize editor with a line on the verge of wrapping, followed by a second line</span>
+  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[abcd</span>
+<span class="Constant">e]</span>
+  <span class="Constant">2</span>:address:shared:editor-data<span class="Special"> &lt;- </span>new-editor <span class="Constant">1</span>:address:shared:array:character, screen:address:shared:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span>
+  editor-render screen, <span class="Constant">2</span>:address:shared:editor-data
+<span class="Constant">  $clear-trace</span>
+  screen-should-contain [
+   <span class="Constant"> .          .</span>
+   <span class="Constant"> .abcd      .</span>
+   <span class="Constant"> .e         .</span>
+   <span class="Constant"> .┈┈┈┈┈     .</span>
+   <span class="Constant"> .          .</span>
+  ]
+  <span class="Comment"># position cursor right after empty line</span>
+  assume-console [
+    left-click <span class="Constant">2</span>, <span class="Constant">0</span>
+    press left-arrow
+  ]
+  run [
+    editor-event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">2</span>:address:shared:editor-data
+    <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>get *<span class="Constant">2</span>:address:shared:editor-data, <span class="Constant">cursor-row:offset</span>
+    <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>get *<span class="Constant">2</span>:address:shared:editor-data, <span class="Constant">cursor-column:offset</span>
+  ]
+  memory-should-contain [
+    <span class="Constant">3</span><span class="Special"> &lt;- </span><span class="Constant">1</span>  <span class="Comment"># previous row</span>
+    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">4</span>  <span class="Comment"># end of wrapped line</span>
   ]
   check-trace-count-for-label <span class="Constant">0</span>, <span class="Constant">[print-character]</span>
 ]
diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html
index c079109e..d7a18512 100644
--- a/html/edit/005-sandbox.mu.html
+++ b/html/edit/005-sandbox.mu.html
@@ -67,12 +67,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 <span class="muData">container</span> sandbox-data [
   data:address:shared:array:character
   response:address:shared:array:character
-  expected-response:address:shared:array:character
   <span class="Comment"># coordinates to track clicks</span>
   <span class="Comment"># constraint: will be 0 for sandboxes at positions before env.render-from</span>
   starting-row-on-screen:number
   code-ending-row-on-screen:number  <span class="Comment"># past end of code</span>
-  response-starting-row-on-screen:number
   screen:address:shared:screen  <span class="Comment"># prints in the sandbox go here</span>
   next-sandbox:address:shared:sandbox-data
 ]
@@ -271,12 +269,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     data:address:shared:array:character<span class="Special"> &lt;- </span>get *curr, <span class="Constant">data:offset</span>
     filename:address:shared:array:character<span class="Special"> &lt;- </span>to-text idx
     save filename, data
-    <span class="Delimiter">{</span>
-      expected-response:address:shared:array:character<span class="Special"> &lt;- </span>get *curr, <span class="Constant">expected-response:offset</span>
-      <span class="muControl">break-unless</span> expected-response
-      filename<span class="Special"> &lt;- </span>append filename, suffix
-      save filename, expected-response
-    <span class="Delimiter">}</span>
+<span class="Constant">    &lt;end-save-sandbox&gt;</span>
     idx<span class="Special"> &lt;- </span>add idx, <span class="Constant">1</span>
     curr<span class="Special"> &lt;- </span>get *curr, <span class="Constant">next-sandbox:offset</span>
     <span class="muControl">loop</span>
@@ -337,7 +330,6 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     code-ending-row:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">code-ending-row-on-screen:offset</span>
     *code-ending-row<span class="Special"> &lt;- </span>copy row
     <span class="Comment"># render sandbox warnings, screen or response, in that order</span>
-    response-starting-row:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>
     sandbox-response:address:shared:array:character<span class="Special"> &lt;- </span>get *sandbox, <span class="Constant">response:offset</span>
 <span class="Constant">    &lt;render-sandbox-results&gt;</span>
     <span class="Delimiter">{</span>
@@ -348,7 +340,6 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     <span class="Delimiter">}</span>
     <span class="Delimiter">{</span>
       <span class="muControl">break-unless</span> empty-screen?
-      *response-starting-row<span class="Special"> &lt;- </span>copy row
 <span class="Constant">      &lt;render-sandbox-response&gt;</span>
       row, screen<span class="Special"> &lt;- </span>render screen, sandbox-response, left, right, <span class="Constant">245/grey</span>, row
     <span class="Delimiter">}</span>
@@ -365,8 +356,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     *tmp<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
     tmp:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">code-ending-row-on-screen:offset</span>
     *tmp<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
-    tmp:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>
-    *tmp<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
+<span class="Constant">    &lt;end-render-sandbox-reset-hidden&gt;</span>
   <span class="Delimiter">}</span>
   <span class="Comment"># draw next sandbox</span>
   next-sandbox:address:shared:sandbox-data<span class="Special"> &lt;- </span>get *sandbox, <span class="Constant">next-sandbox:offset</span>
@@ -395,8 +385,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
       filename<span class="Special"> &lt;- </span>append filename, suffix
       contents<span class="Special"> &lt;- </span>restore filename
       <span class="muControl">break-unless</span> contents
-      expected-response:address:address:shared:array:character<span class="Special"> &lt;- </span>get-address **curr, <span class="Constant">expected-response:offset</span>
-      *expected-response<span class="Special"> &lt;- </span>copy contents
+<span class="Constant">      &lt;end-restore-sandbox&gt;</span>
     <span class="Delimiter">}</span>
 <span class="Constant">    +continue</span>
     idx<span class="Special"> &lt;- </span>add idx, <span class="Constant">1</span>
@@ -482,6 +471,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   <span class="Comment"># define a recipe (no indent for the 'add' line below so column numbers are more obvious)</span>
   <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
 <span class="Constant">recipe foo [</span>
+<span class="Constant">local-scope</span>
 <span class="Constant">z:number &lt;- add 2, 2</span>
 <span class="Constant">reply z</span>
 <span class="Constant">]</span>]
@@ -497,15 +487,16 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
    <span class="Constant"> .                                                                                 run (F4)           .</span>
    <span class="Constant"> .                                                  ┊                                                 .</span>
    <span class="Constant"> .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
-   <span class="Constant"> .z:number &lt;- add 2, 2                              ┊0                                               x.</span>
-   <span class="Constant"> .reply z                                           ┊foo                                              .</span>
-   <span class="Constant"> .]                                                 ┊4                                                .</span>
-<span class="Constant">    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .local-scope                                       ┊0                                               x.</span>
+   <span class="Constant"> .z:number &lt;- add 2, 2                              ┊foo                                              .</span>
+   <span class="Constant"> .reply z                                           ┊4                                                .</span>
+   <span class="Constant"> .]                                                 ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊                                                 .</span>
    <span class="Constant"> .                                                  ┊                                                 .</span>
   ]
   <span class="Comment"># make a change (incrementing one of the args to 'add'), then rerun</span>
   assume-console [
-    left-click <span class="Constant">3</span>, <span class="Constant">28</span>  <span class="Comment"># one past the value of the second arg</span>
+    left-click <span class="Constant">4</span>, <span class="Constant">28</span>  <span class="Comment"># one past the value of the second arg</span>
     press backspace
     type <span class="Constant">[3]</span>
     press F4
@@ -518,10 +509,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
    <span class="Constant"> .                                                                                 run (F4)           .</span>
    <span class="Constant"> .                                                  ┊                                                 .</span>
    <span class="Constant"> .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
-   <span class="Constant"> .z:number &lt;- add 2, 3                              ┊0                                               x.</span>
-   <span class="Constant"> .reply z                                           ┊foo                                              .</span>
-   <span class="Constant"> .]                                                 ┊5                                                .</span>
-<span class="Constant">    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .local-scope                                       ┊0                                               x.</span>
+   <span class="Constant"> .z:number &lt;- add 2, 3                              ┊foo                                              .</span>
+   <span class="Constant"> .reply z                                           ┊5                                                .</span>
+   <span class="Constant"> .]                                                 ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊                                                 .</span>
    <span class="Constant"> .                                                  ┊                                                 .</span>
   ]
 ]
@@ -757,9 +749,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   assume-console [
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   <span class="Comment"># hit 'down' in recipe editor</span>
   assume-console [
     press down-arrow
@@ -769,8 +759,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     <span class="Constant">4</span>:character/cursor<span class="Special"> &lt;- </span>copy <span class="Constant">9251/␣</span>
     print screen:address:shared:screen, <span class="Constant">4</span>:character/cursor
   ]
-  <span class="Comment"># sandbox editor hidden; first sandbox displayed</span>
-  <span class="Comment"># cursor moves to first sandbox</span>
+  <span class="Comment"># cursor moves down on recipe side</span>
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊              .</span>
@@ -799,11 +788,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     type <span class="Constant">[add 1, 1]</span>
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-    <span class="Constant">4</span>:character/cursor<span class="Special"> &lt;- </span>copy <span class="Constant">9251/␣</span>
-    print screen:address:shared:screen, <span class="Constant">4</span>:character/cursor
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
+  <span class="Constant">4</span>:character/cursor<span class="Special"> &lt;- </span>copy <span class="Constant">9251/␣</span>
+  print screen:address:shared:screen, <span class="Constant">4</span>:character/cursor
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊␣             .</span>
@@ -953,9 +940,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     type <span class="Constant">[add 1, 1]</span>
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊              .</span>
diff --git a/html/edit/006-sandbox-edit.mu.html b/html/edit/006-sandbox-edit.mu.html
index a4830985..f5b59339 100644
--- a/html/edit/006-sandbox-edit.mu.html
+++ b/html/edit/006-sandbox-edit.mu.html
@@ -224,9 +224,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     press down-arrow
     press down-arrow
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊━━━━━━━━━━━━━━.</span>
@@ -272,9 +270,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     type <span class="Constant">[add 1, 1]</span>
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊              .</span>
diff --git a/html/edit/007-sandbox-delete.mu.html b/html/edit/007-sandbox-delete.mu.html
index b88de17f..954dcd58 100644
--- a/html/edit/007-sandbox-delete.mu.html
+++ b/html/edit/007-sandbox-delete.mu.html
@@ -168,9 +168,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     press F4
     press down-arrow
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊━━━━━━━━━━━━━━.</span>
@@ -216,9 +214,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     press F4
     press down-arrow
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊━━━━━━━━━━━━━━.</span>
@@ -265,9 +261,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     press down-arrow
     press down-arrow
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊━━━━━━━━━━━━━━.</span>
@@ -313,9 +307,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     type <span class="Constant">[add 1, 1]</span>
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .                              .</span>
    <span class="Constant"> .               ┊              .</span>
diff --git a/html/edit/008-sandbox-test.mu.html b/html/edit/008-sandbox-test.mu.html
index d5dbcfcb..28a098ae 100644
--- a/html/edit/008-sandbox-test.mu.html
+++ b/html/edit/008-sandbox-test.mu.html
@@ -16,6 +16,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 .muControl { color: #c0a020; }
 .muRecipe { color: #ff8700; }
 .muScenario { color: #00af00; }
+.muData { color: #ffff00; }
 .Special { color: #ff6060; }
 .Comment { color: #9090ff; }
 .Constant { color: #00a0a0; }
@@ -116,6 +117,27 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   ]
 ]
 
+<span class="Comment"># this requires tracking a couple more things</span>
+<span class="muData">container</span> sandbox-data [
+  response-starting-row-on-screen:number
+  expected-response:address:shared:array:character
+]
+
+<span class="Comment"># include expected response when saving or restoring a sandbox</span>
+<span class="muRecipe">before</span> <span class="Constant">&lt;end-save-sandbox&gt;</span> [
+  <span class="Delimiter">{</span>
+    expected-response:address:shared:array:character<span class="Special"> &lt;- </span>get *curr, <span class="Constant">expected-response:offset</span>
+    <span class="muControl">break-unless</span> expected-response
+    filename<span class="Special"> &lt;- </span>append filename, suffix
+    save filename, expected-response
+  <span class="Delimiter">}</span>
+]
+
+<span class="muRecipe">before</span> <span class="Constant">&lt;end-restore-sandbox&gt;</span> [
+  expected-response:address:address:shared:array:character<span class="Special"> &lt;- </span>get-address **curr, <span class="Constant">expected-response:offset</span>
+  *expected-response<span class="Special"> &lt;- </span>copy contents
+]
+
 <span class="Comment"># clicks on sandbox responses save it as 'expected'</span>
 <span class="muRecipe">after</span> <span class="Constant">&lt;global-touch&gt;</span> [
   <span class="Comment"># check if it's inside the output of any sandbox</span>
@@ -190,6 +212,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 <span class="muRecipe">after</span> <span class="Constant">&lt;render-sandbox-response&gt;</span> [
   <span class="Delimiter">{</span>
     <span class="muControl">break-unless</span> sandbox-response
+    response-starting-row:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>
+    *response-starting-row<span class="Special"> &lt;- </span>copy row
     expected-response:address:shared:array:character<span class="Special"> &lt;- </span>get *sandbox, <span class="Constant">expected-response:offset</span>
     <span class="muControl">break-unless</span> expected-response  <span class="Comment"># fall-through to print in grey</span>
     response-is-expected?:boolean<span class="Special"> &lt;- </span>equal expected-response, sandbox-response
@@ -204,6 +228,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
     <span class="muControl">jump</span> <span class="Constant">+render-sandbox-end:label</span>
   <span class="Delimiter">}</span>
 ]
+
+<span class="muRecipe">before</span> <span class="Constant">&lt;end-render-sandbox-reset-hidden&gt;</span> [
+  tmp:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>
+  *tmp<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
+]
 </pre>
 </body>
 </html>
diff --git a/html/edit/010-warnings.mu.html b/html/edit/010-warnings.mu.html
index a9b81c9e..eca63962 100644
--- a/html/edit/010-warnings.mu.html
+++ b/html/edit/010-warnings.mu.html
@@ -153,6 +153,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   <span class="Delimiter">{</span>
     sandbox-warnings:address:shared:array:character<span class="Special"> &lt;- </span>get *sandbox, <span class="Constant">warnings:offset</span>
     <span class="muControl">break-unless</span> sandbox-warnings
+    response-starting-row:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>
     *response-starting-row<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>  <span class="Comment"># no response</span>
     row, screen<span class="Special"> &lt;- </span>render screen, sandbox-warnings, left, right, <span class="Constant">1/red</span>, row
     <span class="Comment"># don't try to print anything more for this sandbox</span>
@@ -218,7 +219,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   run [
     event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   ]
-  <span class="Comment"># status shows first sandbox with error</span>
+  <span class="Comment"># status line shows that error is in first sandbox</span>
   screen-should-contain [
    <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   ]
@@ -245,7 +246,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   run [
     event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   ]
-  <span class="Comment"># status shows first sandbox with error</span>
+  <span class="Comment"># status line shows that error is in second sandbox</span>
   screen-should-contain [
    <span class="Constant"> .  errors found (1)                                                               run (F4)           .</span>
   ]
@@ -299,9 +300,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   assume-console [
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
    <span class="Constant"> .recipe foo x:_elem -&gt; z:_elem [                   ┊                                                 .</span>
@@ -453,6 +452,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
   <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
 <span class="Constant">recipe foo [</span>
+<span class="Constant">  local-scope</span>
 <span class="Constant">  x:address:shared:point &lt;- new point:type</span>
 <span class="Constant">  get x:address:shared:point, 1:offset</span>
 <span class="Constant">]</span>]
@@ -468,6 +468,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
    <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
    <span class="Constant"> .                                                  ┊foo                                              .</span>
    <span class="Constant"> .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .  local-scope                                     ┊                                                 .</span>
    <span class="Constant"> .  x:address:shared:point &lt;- new point:type        ┊                                                 .</span>
    <span class="Constant"> .  get x:address:shared:point, 1:offset            ┊                                                 .</span>
    <span class="Constant"> .]                                                 ┊                                                 .</span>
@@ -483,6 +484,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
   <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
 <span class="Constant">recipe foo [</span>
+<span class="Constant">  local-scope</span>
 <span class="Constant">  x:number &lt;- copy 0</span>
 <span class="Constant">  y:address:shared:point &lt;- new point:type</span>
 <span class="Constant">  get *y:address:shared:point, x:number</span>
@@ -499,6 +501,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
    <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
    <span class="Constant"> .                                                  ┊foo                                              .</span>
    <span class="Constant"> .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .  local-scope                                     ┊                                                 .</span>
    <span class="Constant"> .  x:number &lt;- copy 0                              ┊                                                 .</span>
    <span class="Constant"> .  y:address:shared:point &lt;- new point:type        ┊                                                 .</span>
    <span class="Constant"> .  get *y:address:shared:point, x:number           ┊                                                 .</span>
@@ -518,6 +521,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
   <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
 <span class="Constant">recipe foo [</span>
+<span class="Constant">  local-scope</span>
 <span class="Constant">  x:number &lt;- copy y:number</span>
 <span class="Constant">]</span>]
   <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
@@ -525,13 +529,12 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
   assume-console [
     press F4
   ]
-  run [
-    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
-  ]
+  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
   screen-should-contain [
    <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
    <span class="Constant"> .                                                  ┊foo                                              .</span>
    <span class="Constant"> .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .  local-scope                                     ┊                                                 .</span>
    <span class="Constant"> .  x:number &lt;- copy y:number                       ┊                                                 .</span>
    <span class="Constant"> .]                                                 ┊                                                 .</span>
    <span class="Constant"> .foo: use before set: y                            ┊                                                 .</span>
@@ -549,6 +552,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
    <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
    <span class="Constant"> .                                                  ┊foo                                              .</span>
    <span class="Constant"> .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span>
+   <span class="Constant"> .  local-scope                                     ┊                                                 .</span>
    <span class="Constant"> .  x:number &lt;- copy y:number                       ┊                                                 .</span>
    <span class="Constant"> .]                                                 ┊                                                 .</span>
    <span class="Constant"> .foo: use before set: y                            ┊                                                 .</span>