diff options
Diffstat (limited to 'html/edit')
-rw-r--r-- | html/edit/002-typing.mu.html | 102 | ||||
-rw-r--r-- | html/edit/003-shortcuts.mu.html | 348 | ||||
-rw-r--r-- | html/edit/004-programming-environment.mu.html | 28 | ||||
-rw-r--r-- | html/edit/005-sandbox.mu.html | 94 | ||||
-rw-r--r-- | html/edit/006-sandbox-copy.mu.html | 24 | ||||
-rw-r--r-- | html/edit/007-sandbox-delete.mu.html | 32 | ||||
-rw-r--r-- | html/edit/008-sandbox-edit.mu.html | 36 | ||||
-rw-r--r-- | html/edit/009-sandbox-test.mu.html | 10 | ||||
-rw-r--r-- | html/edit/010-sandbox-trace.mu.html | 24 | ||||
-rw-r--r-- | html/edit/011-errors.mu.html | 70 | ||||
-rw-r--r-- | html/edit/012-editor-undo.mu.html | 246 |
11 files changed, 507 insertions, 507 deletions
diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index e8d68e3f..c2c0efb5 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -55,7 +55,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color cursor-row:num<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-row:offset</span> cursor-column:num<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-column:offset</span> screen<span class="Special"> <- </span>move-cursor screen, cursor-row, cursor-column - e:event, console:&:console, found?:bool, quit?:bool<span class="Special"> <- </span>read-event console + e:event, console, found?:bool, quit?:bool<span class="Special"> <- </span>read-event console <span class="muControl">loop-unless</span> found? <span class="muControl">break-if</span> quit? <span class="Comment"># only in tests</span> trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[next-event]</span> @@ -318,11 +318,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-handles-empty-event-queue [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console <span class="Constant">[]</span> run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -335,14 +335,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-handles-mouse-clicks [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">1</span> <span class="Comment"># on the 'b'</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -362,13 +362,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-handles-mouse-clicks-outside-text [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Constant"> $clear-trace</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">7</span> <span class="Comment"># last line, to the right of text</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -384,13 +384,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Constant"> $clear-trace</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">7</span> <span class="Comment"># interior line, to the right of text</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -406,13 +406,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Constant"> $clear-trace</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">7</span> <span class="Comment"># below text</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -427,7 +427,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> <span class="Comment"># editor occupies only left half of screen</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -435,7 +435,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">8</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -455,7 +455,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-handles-mouse-clicks-in-menu-area [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -463,7 +463,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">0</span>, <span class="Constant">3</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -477,14 +477,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-inserts-characters-into-empty-editor [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ type <span class="Constant">[abc]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -498,7 +498,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-inserts-characters-at-cursor [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># type two letters at different places</span> @@ -508,7 +508,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[d]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -522,7 +522,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-inserts-characters-at-cursor-2 [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -530,7 +530,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[d]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -546,7 +546,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -554,7 +554,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[e]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -569,7 +569,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-inserts-characters-at-cursor-3 [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -577,7 +577,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[d]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -593,7 +593,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -601,7 +601,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[e]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -618,7 +618,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -626,7 +626,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[ef]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -641,13 +641,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-after-inserting-characters [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[ab]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[ab]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e assume-console [ type <span class="Constant">[01]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -662,14 +662,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-wraps-line-on-insert [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">5/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Comment"># type a letter</span> assume-console [ type <span class="Constant">[e]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># no wrap yet</span> screen-should-contain [ @@ -684,7 +684,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[f]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># now wrap</span> screen-should-contain [ @@ -702,7 +702,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abcdefg</span> <span class="Constant">defg]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Comment"># type more text at the start</span> assume-console [ @@ -710,7 +710,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[abc]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -783,13 +783,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-wraps-cursor-after-inserting-characters-in-middle-of-line [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">3</span> <span class="Comment"># right before the wrap icon</span> type <span class="Constant">[f]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -824,7 +824,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[de]</span> <span class="Comment"># trigger wrap</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -838,13 +838,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-wraps-cursor-to-left-margin [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen:&:screen, <span class="Constant">2/left</span>, <span class="Constant">7/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen, <span class="Constant">2/left</span>, <span class="Constant">7/right</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">5</span> <span class="Comment"># line is full; no wrap icon yet</span> type <span class="Constant">[01]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -874,13 +874,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-down-after-inserting-newline [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> assume-console [ type <span class="Constant">[0</span> <span class="Constant">1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -980,13 +980,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-down-after-inserting-newline-2 [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">1/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">1/left</span>, <span class="Constant">10/right</span> assume-console [ type <span class="Constant">[0</span> <span class="Constant">1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1000,7 +1000,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-clears-previous-line-completely-after-inserting-newline [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> assume-console [ press enter ] @@ -1012,7 +1012,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant"> . .</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># line should be fully cleared</span> screen-should-contain [ @@ -1030,7 +1030,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text<span class="Special"> <- </span>new <span class="Constant">[ab</span> <span class="Constant"> cd</span> <span class="Constant">ef]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># position cursor after 'cd' and hit 'newline'</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">8</span> @@ -1038,7 +1038,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1055,7 +1055,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text<span class="Special"> <- </span>new <span class="Constant">[ab</span> <span class="Constant"> cd</span> <span class="Constant">ef]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># position cursor after 'cd' and hit 'newline' surrounded by paste markers</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">8</span> @@ -1064,7 +1064,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press <span class="Constant">65506</span> <span class="Comment"># end paste</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index f909a4c7..bac26d3c 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -44,12 +44,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># just one character in final line</span> s:text<span class="Special"> <- </span>new <span class="Constant">[ab</span> <span class="Constant">cd]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> assume-console [ press tab ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -76,7 +76,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-handles-backspace-key [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -84,7 +84,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -256,13 +256,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># just one character in final line</span> s:text<span class="Special"> <- </span>new <span class="Constant">[ab</span> <span class="Constant">cd]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">0</span> <span class="Comment"># cursor at only character in final line</span> press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -284,7 +284,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># initialize editor with two long-ish but non-wrapping lines</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc def</span> <span class="Constant">ghi jkl]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># position the cursor at the start of the second and hit backspace</span> @@ -293,7 +293,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># resulting single line should wrap correctly</span> screen-should-contain [ @@ -309,7 +309,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> <span class="Comment"># initialize editor in part of the screen with a long line</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc def ghij]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">8/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc def ghij]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">8/right</span> editor-render screen, e <span class="Comment"># confirm that it wraps</span> screen-should-contain [ @@ -325,7 +325,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># resulting single line should wrap correctly and not overflow its bounds</span> screen-should-contain [ @@ -342,14 +342,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-handles-delete-key [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ press delete ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -363,7 +363,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press delete ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -431,7 +431,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-right-with-key [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -439,7 +439,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -530,7 +530,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># type right-arrow a few times to get to start of second line</span> @@ -541,7 +541,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow <span class="Comment"># next line</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] check-trace-count-for-label <span class="Constant">0</span>, <span class="Constant">[print-character]</span> <span class="Comment"># type something and ensure it goes where it should</span> @@ -549,7 +549,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -566,7 +566,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">1/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">1/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ press right-arrow @@ -576,7 +576,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -590,7 +590,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcdef]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcdef]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -598,7 +598,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -620,7 +620,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> <span class="Comment"># line just barely wrapping</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcde]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># position cursor at last character before wrap and hit right-arrow</span> @@ -629,7 +629,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -642,7 +642,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -656,7 +656,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcdef]</span>, screen:&:screen, <span class="Constant">1/left</span>, <span class="Constant">6/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcdef]</span>, screen, <span class="Constant">1/left</span>, <span class="Constant">6/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -664,7 +664,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -687,7 +687,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># move to end of line, press right-arrow, type a character</span> @@ -697,7 +697,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># new character should be in next line</span> screen-should-contain [ @@ -717,7 +717,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-moves-cursor-left-with-key [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -726,7 +726,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -762,7 +762,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># initialize editor with two lines</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># position cursor at start of second line (so there's no previous newline)</span> @@ -771,7 +771,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -789,7 +789,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">g]</span> - e:&:editor<span class="Special"> <- </span>new-editor s:text, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s:text, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># position cursor further down (so there's a newline before the character at</span> @@ -800,7 +800,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -818,7 +818,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">g]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># position cursor at start of text, press left-arrow, then type a character</span> @@ -828,7 +828,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># left-arrow should have had no effect</span> screen-should-contain [ @@ -848,7 +848,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> d] - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e:&:editor <span class="Constant"> $clear-trace</span> <span class="Comment"># position cursor right after empty line</span> @@ -858,7 +858,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -874,7 +874,7 @@ d] <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> <span class="Comment"># initialize editor with a wrapping line</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcdef]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abcdef]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> screen-should-contain [ @@ -890,7 +890,7 @@ d] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -907,7 +907,7 @@ d] <span class="Comment"># initialize editor with a wrapping line followed by a second line</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abcdef</span> <span class="Constant">g]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> screen-should-contain [ @@ -923,7 +923,7 @@ d] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -940,7 +940,7 @@ d] <span class="Comment"># initialize editor with a line on the verge of wrapping, followed by a second line</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abcd</span> <span class="Constant">e]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> screen-should-contain [ @@ -956,7 +956,7 @@ d] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -976,7 +976,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -984,7 +984,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -997,7 +997,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1093,7 +1093,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[ab</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -1101,7 +1101,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1114,7 +1114,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1130,7 +1130,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new [ <span class="muRecipe">def</span>] - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -1138,7 +1138,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1151,7 +1151,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1169,7 +1169,7 @@ d] s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># click on the third line and hit up-arrow, so you end up just after a newline</span> @@ -1178,7 +1178,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1191,7 +1191,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1209,7 +1209,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># cursor starts out at (1, 0)</span> @@ -1217,7 +1217,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1231,7 +1231,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1315,7 +1315,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">de]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> assume-console [ @@ -1323,7 +1323,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1336,7 +1336,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1354,7 +1354,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on second line, press ctrl-a</span> @@ -1363,7 +1363,7 @@ d] press ctrl-a ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1430,7 +1430,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on first line (no newline before), press ctrl-a</span> @@ -1439,7 +1439,7 @@ d] press ctrl-a ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1456,7 +1456,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Constant"> $clear-trace</span> <span class="Comment"># start on second line, press 'home'</span> assume-console [ @@ -1464,7 +1464,7 @@ d] press home ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1481,7 +1481,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on first line (no newline before), press 'home'</span> @@ -1490,7 +1490,7 @@ d] press home ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1509,7 +1509,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on first line, press ctrl-e</span> @@ -1518,7 +1518,7 @@ d] press ctrl-e ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1533,7 +1533,7 @@ d] type <span class="Constant">[z]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1602,7 +1602,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on second line (no newline after), press ctrl-e</span> @@ -1611,7 +1611,7 @@ d] press ctrl-e ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1628,7 +1628,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on first line, press 'end'</span> @@ -1637,7 +1637,7 @@ d] press end ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1654,7 +1654,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># start on second line (no newline after), press 'end'</span> @@ -1663,7 +1663,7 @@ d] press end ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1682,14 +1682,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start on second line, press ctrl-u</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">2</span> press ctrl-u ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes to start of line</span> screen-should-contain [ @@ -1746,14 +1746,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start on first line (no newline before), press ctrl-u</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">2</span> press ctrl-u ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes to start of line</span> screen-should-contain [ @@ -1770,14 +1770,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start past end of line, press ctrl-u</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">3</span> press ctrl-u ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes to start of line</span> screen-should-contain [ @@ -1794,14 +1794,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start past end of final line, press ctrl-u</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">3</span> press ctrl-u ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes to start of line</span> screen-should-contain [ @@ -1820,14 +1820,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start on first line, press ctrl-k</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">1</span> press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes to end of line</span> screen-should-contain [ @@ -1876,14 +1876,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start on second line (no newline after), press ctrl-k</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">1</span> press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes to end of line</span> screen-should-contain [ @@ -1900,14 +1900,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start at end of line</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">2</span> press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes just last character</span> screen-should-contain [ @@ -1924,14 +1924,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start past end of line</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">3</span> press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes nothing</span> screen-should-contain [ @@ -1948,14 +1948,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start at end of text</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">2</span> press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes just the final character</span> screen-should-contain [ @@ -1972,14 +1972,14 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[123</span> <span class="Constant">456]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> <span class="Comment"># start past end of text</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">3</span> press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor deletes nothing</span> screen-should-contain [ @@ -2002,7 +2002,7 @@ d] <span class="Constant">b</span> <span class="Constant">c</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -2015,7 +2015,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen slides by one line</span> screen-should-contain [ @@ -2081,7 +2081,7 @@ d] <span class="Constant">g</span> <span class="Constant">h</span> <span class="Constant">i]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .abcd↩ .</span> @@ -2094,7 +2094,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2114,14 +2114,14 @@ d] <span class="Constant">k</span> <span class="Constant">l</span> <span class="Constant">m]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at last line, then try to move further down</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">0</span> press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line containing a wrap icon</span> screen-should-contain [ @@ -2135,7 +2135,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2154,14 +2154,14 @@ d] s:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">b</span> <span class="Constant">cdef]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at end, type a character</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">4</span> type <span class="Constant">[g]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2185,14 +2185,14 @@ d] s:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">b</span> <span class="Constant">c]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">4</span> type [ ] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2217,14 +2217,14 @@ d] s:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">b</span> <span class="Constant">cdefgh]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at end of screen and try to move right</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">3</span> press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2250,14 +2250,14 @@ d] <span class="Constant">b</span> <span class="Constant">c</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at end of screen and try to move right</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">3</span> press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2279,7 +2279,7 @@ d] assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">de]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Constant"> $clear-trace</span> <span class="Comment"># try to move down past end of text</span> @@ -2288,7 +2288,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2301,7 +2301,7 @@ d] type <span class="Constant">[0]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2316,7 +2316,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2330,7 +2330,7 @@ d] type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2352,7 +2352,7 @@ d] <span class="Constant">e</span> <span class="Constant">f</span> <span class="Constant">g]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># scroll down one page and one line</span> assume-console [ press page-down @@ -2360,7 +2360,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen scrolls down 3 lines</span> screen-should-contain [ @@ -2382,7 +2382,7 @@ d] <span class="Constant">b</span> <span class="Constant">c</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -2395,7 +2395,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen slides by one line</span> screen-should-contain [ @@ -2471,7 +2471,7 @@ d] <span class="Constant">g</span> <span class="Constant">h</span> <span class="Constant">i]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .abcd↩ .</span> @@ -2483,7 +2483,7 @@ d] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2496,7 +2496,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2516,13 +2516,13 @@ d] <span class="Constant">k</span> <span class="Constant">l</span> <span class="Constant">m]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at top of second page</span> assume-console [ press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2536,7 +2536,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2551,7 +2551,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2566,7 +2566,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2590,7 +2590,7 @@ d] <span class="Constant">g</span> <span class="Constant">h</span> <span class="Constant">i]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">6/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">6/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .abcde↩ .</span> @@ -2602,7 +2602,7 @@ d] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2615,7 +2615,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows partial wrapped line</span> screen-should-contain [ @@ -2637,12 +2637,12 @@ d] c d e] - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">6/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">6/right</span> assume-console [ press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2654,7 +2654,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2666,7 +2666,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2686,13 +2686,13 @@ e] <span class="Constant">c</span> <span class="Constant">d</span> <span class="Constant">e]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at top of second page</span> assume-console [ press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2705,7 +2705,7 @@ e] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -2731,7 +2731,7 @@ e] <span class="Constant">b</span> <span class="Constant">c</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -2746,7 +2746,7 @@ e] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen slides by one line</span> screen-should-contain [ @@ -2760,7 +2760,7 @@ e] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen remains unchanged</span> screen-should-contain [ @@ -2780,7 +2780,7 @@ e] <span class="Constant">b</span> <span class="Constant">c</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -2792,7 +2792,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows next page</span> screen-should-contain [ @@ -2866,7 +2866,7 @@ e] assume-screen <span class="Constant">10/width</span>, <span class="Constant">4/height</span> s:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">b]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e screen-should-contain [ <span class="Constant"> . .</span> @@ -2879,7 +2879,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen remains unmodified</span> screen-should-contain [ @@ -2899,7 +2899,7 @@ e] <span class="Constant">b</span> <span class="Constant">cdefgh]</span> <span class="Comment"># editor screen triggers wrap of last line</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> <span class="Comment"># some part of last line is not displayed</span> screen-should-contain [ <span class="Constant"> . .</span> @@ -2912,7 +2912,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows entire wrapped line</span> screen-should-contain [ @@ -2931,7 +2931,7 @@ e] <span class="Comment"># and still has something left over</span> s:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">bcdefgh]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> <span class="Comment"># some part of last line is not displayed</span> screen-should-contain [ <span class="Constant"> . .</span> @@ -2944,7 +2944,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows entire wrapped line</span> screen-should-contain [ @@ -2964,7 +2964,7 @@ e] <span class="Constant">b</span> <span class="Constant">c</span> <span class="Constant">d]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -2976,7 +2976,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows next page</span> screen-should-contain [ @@ -2990,7 +2990,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows original page again</span> screen-should-contain [ @@ -3065,7 +3065,7 @@ e] <span class="Constant">f</span> <span class="Constant">g</span> <span class="Constant">h]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -3078,7 +3078,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows third page</span> screen-should-contain [ @@ -3092,7 +3092,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows second page</span> screen-should-contain [ @@ -3106,7 +3106,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows original page again</span> screen-should-contain [ @@ -3133,7 +3133,7 @@ e] <span class="Constant">n</span> <span class="Constant">o]</span> <span class="Comment"># editor screen triggers wrap of last line</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> <span class="Comment"># some part of last line is not displayed</span> screen-should-contain [ <span class="Constant"> . .</span> @@ -3150,7 +3150,7 @@ e] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows entire wrapped line</span> screen-should-contain [ @@ -3166,7 +3166,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen resets</span> screen-should-contain [ @@ -3187,7 +3187,7 @@ e] <span class="Comment"># and still has something left over</span> s:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">bcdefgh]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> <span class="Comment"># some part of last line is not displayed</span> screen-should-contain [ <span class="Constant"> . .</span> @@ -3200,7 +3200,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen shows entire wrapped line</span> screen-should-contain [ @@ -3214,7 +3214,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen resets</span> screen-should-contain [ @@ -3238,7 +3238,7 @@ e] <span class="Constant">gxx</span> <span class="Constant">hxx</span> <span class="Constant">]</span> - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .axx .</span> @@ -3249,7 +3249,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -3261,7 +3261,7 @@ e] press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -3274,7 +3274,7 @@ e] press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -3297,7 +3297,7 @@ exy fxy gxy ] - e:&:editor<span class="Special"> <- </span>new-editor s, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> + e:&:editor<span class="Special"> <- </span>new-editor s, screen, <span class="Constant">0/left</span>, <span class="Constant">4/right</span> screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .axy .</span> @@ -3308,7 +3308,7 @@ gxy press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -3320,7 +3320,7 @@ gxy press page-down ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -3333,7 +3333,7 @@ gxy press page-up ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index 6e6ba954..c6bcff5a 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -332,7 +332,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">30/width</span>, <span class="Constant">5/height</span> <span class="Comment"># initialize both halves of screen</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> <span class="Comment"># focus on both sides</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">1</span> @@ -340,7 +340,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] <span class="Comment"># check cursor column in each</span> run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env recipes:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *recipes, <span class="Constant">cursor-column:offset</span> sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> @@ -357,7 +357,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">30/width</span>, <span class="Constant">5/height</span> <span class="Comment"># initialize both halves of screen</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> render-all screen, env, render <span class="Comment"># type one letter in each of them</span> assume-console [ @@ -367,7 +367,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env recipes:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> <span class="Constant">5</span>:num/<span class="Special">raw <- </span>get *recipes, <span class="Constant">cursor-column:offset</span> sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> @@ -386,7 +386,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># show the cursor at the right window</span> run [ cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -401,7 +401,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">60/width</span>, <span class="Constant">10/height</span> run [ - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> render-all screen, env, render ] <span class="Comment"># divider isn't messed up</span> @@ -418,14 +418,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">30/width</span>, <span class="Constant">5/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[abc]</span>, <span class="Constant">[def]</span> render-all screen, env, render <span class="Comment"># initialize programming environment and highlight cursor</span> assume-console <span class="Constant">[]</span> run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># is cursor at the right place?</span> screen-should-contain [ @@ -439,9 +439,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[z]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># cursor should still be right</span> screen-should-contain [ @@ -459,7 +459,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># initialize sandbox side with two lines</span> s:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, s:text + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, s:text render-all screen, env, render screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -474,9 +474,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press backspace ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># cursor moves to end of old line</span> screen-should-contain [ diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index 8f328e91..17da0bdd 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -82,13 +82,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> <span class="Comment"># recipe editor is empty</span> <span class="Comment"># sandbox editor contains an instruction without storing outputs</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[divide-with-remainder 11, 3]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[divide-with-remainder 11, 3]</span> <span class="Comment"># run the code in the editors</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># check that screen prints the results</span> screen-should-contain [ @@ -138,7 +138,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># check that screen prints both sandboxes</span> screen-should-contain [ @@ -561,12 +561,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">reply z</span> <span class="Constant">]</span>] <span class="Comment"># sandbox editor contains an instruction without storing outputs</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run the code in the editors</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -586,7 +586,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># check that screen updates the result on the right</span> screen-should-contain [ @@ -608,13 +608,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">100/width</span>, <span class="Constant">20/height</span> <span class="Comment"># left editor is empty</span> <span class="Comment"># right editor contains an instruction</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[print-integer screen, 4]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[print-integer screen, 4]</span> <span class="Comment"># run the code in the editor</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># check that it prints a little toy screen</span> screen-should-contain [ @@ -656,13 +656,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> editor-provides-edited-contents [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">2</span> type <span class="Constant">[def]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e s:text<span class="Special"> <- </span>editor-contents e <span class="Constant">1</span>:@:char/<span class="Special">raw <- </span>copy *s ] @@ -677,13 +677,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render assume-console [ press enter press down-arrow ] - event-loop screen, console:&:console, env + event-loop screen, console, env <span class="Comment"># no scroll</span> screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -698,16 +698,16 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render assume-console [ press enter press up-arrow press down-arrow <span class="Comment"># while cursor isn't at bottom</span> ] - event-loop screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor <span class="Comment"># cursor moves back to bottom</span> screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -776,7 +776,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render assume-console [ <span class="Comment"># add a line</span> @@ -786,7 +786,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># try to scroll</span> press page-down <span class="Comment"># or ctrl-f</span> ] - event-loop screen, console:&:console, env + event-loop screen, console, env <span class="Comment"># no scroll, and cursor remains at top line</span> screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -801,7 +801,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[ab</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[ab</span> <span class="Constant">cd]</span> render-all screen, env, render assume-console [ @@ -812,9 +812,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># move cursor</span> press down-arrow ] - event-loop screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor <span class="Comment"># no scroll on recipe side, cursor moves on sandbox side</span> screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -832,13 +832,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize sandbox side</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[add 2, 2]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[add 2, 2]</span> render-all screen, env, render assume-console [ <span class="Comment"># create a sandbox</span> press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -852,9 +852,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># sandbox editor hidden; first sandbox displayed</span> <span class="Comment"># cursor moves to first sandbox</span> @@ -870,9 +870,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># sandbox editor displays again, cursor is in editor</span> screen-should-contain [ @@ -967,20 +967,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color recipes:text<span class="Special"> <- </span>new <span class="Constant">[ </span> <span class="Constant">]</span> <span class="Comment"># create a sandbox</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes:text, <span class="Constant">[add 2, 2]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes:text, <span class="Constant">[add 2, 2]</span> render-all screen, env, render assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env <span class="Comment"># hit 'down' in recipe editor</span> assume-console [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># cursor moves down on recipe side</span> screen-should-contain [ @@ -997,7 +997,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes</span> assume-console [ @@ -1007,9 +1007,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[add 1, 1]</span> press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊␣ .</span> @@ -1027,9 +1027,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># sandbox editor hidden; first sandbox displayed</span> <span class="Comment"># cursor moves to first sandbox</span> @@ -1049,7 +1049,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># just second sandbox displayed</span> screen-should-contain [ @@ -1066,7 +1066,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># no change</span> screen-should-contain [ @@ -1083,7 +1083,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># back to displaying both sandboxes without editor</span> screen-should-contain [ @@ -1102,9 +1102,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># back to displaying both sandboxes as well as editor</span> screen-should-contain [ @@ -1124,9 +1124,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># no change</span> screen-should-contain [ @@ -1148,7 +1148,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create a sandbox</span> assume-console [ @@ -1156,7 +1156,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[add 1, 1]</span> press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -1172,7 +1172,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># sandbox editor hidden; first sandbox displayed</span> <span class="Comment"># cursor moves to first sandbox</span> @@ -1190,7 +1190,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># back to displaying both sandboxes as well as editor</span> screen-should-contain [ @@ -1208,7 +1208,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># sandbox editor hidden; first sandbox displayed</span> <span class="Comment"># cursor moves to first sandbox</span> diff --git a/html/edit/006-sandbox-copy.mu.html b/html/edit/006-sandbox-copy.mu.html index c7f0d656..27ff4b86 100644 --- a/html/edit/006-sandbox-copy.mu.html +++ b/html/edit/006-sandbox-copy.mu.html @@ -44,12 +44,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> reply 4</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -65,7 +65,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">69</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># it copies into editor</span> screen-should-contain [ @@ -83,7 +83,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -106,12 +106,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> reply 4</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -127,7 +127,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">84</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># it copies into editor</span> screen-should-contain [ @@ -145,7 +145,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -263,12 +263,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> reply 4</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -286,7 +286,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">70</span> <span class="Comment"># click 'copy' button</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># copy doesn't happen</span> screen-should-contain [ @@ -304,7 +304,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> diff --git a/html/edit/007-sandbox-delete.mu.html b/html/edit/007-sandbox-delete.mu.html index 285e063e..d1ab4452 100644 --- a/html/edit/007-sandbox-delete.mu.html +++ b/html/edit/007-sandbox-delete.mu.html @@ -38,7 +38,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> <span class="Comment"># run a few commands</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">80</span> @@ -47,7 +47,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[add 2, 2]</span> press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -68,7 +68,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">7</span>, <span class="Constant">85</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -86,7 +86,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">99</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -185,7 +185,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes and scroll to second</span> assume-console [ @@ -196,7 +196,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span> @@ -211,7 +211,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">6</span>, <span class="Constant">99</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># second sandbox shows in editor; scroll resets to display first sandbox</span> screen-should-contain [ @@ -230,7 +230,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes and scroll to second</span> assume-console [ @@ -241,7 +241,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span> @@ -256,7 +256,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">2</span>, <span class="Constant">99</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># second sandbox shows in editor; scroll resets to display first sandbox</span> screen-should-contain [ @@ -275,7 +275,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes and scroll to second</span> assume-console [ @@ -287,7 +287,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span> @@ -302,7 +302,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">2</span>, <span class="Constant">99</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># implicitly scroll up to first sandbox</span> screen-should-contain [ @@ -322,7 +322,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes</span> assume-console [ @@ -332,7 +332,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[add 1, 1]</span> press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -352,7 +352,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># shouldn't go past last sandbox</span> screen-should-contain [ diff --git a/html/edit/008-sandbox-edit.mu.html b/html/edit/008-sandbox-edit.mu.html index b3f3751a..8b8cf20d 100644 --- a/html/edit/008-sandbox-edit.mu.html +++ b/html/edit/008-sandbox-edit.mu.html @@ -43,12 +43,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> reply 4</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -64,7 +64,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">55</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># it pops back into editor</span> screen-should-contain [ @@ -81,7 +81,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -103,12 +103,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> reply 4</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -124,7 +124,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">68</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># it pops back into editor</span> screen-should-contain [ @@ -141,7 +141,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -213,12 +213,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">100/width</span>, <span class="Constant">20/height</span> <span class="Comment"># left editor is empty</span> <span class="Comment"># right editor contains an instruction</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[print-integer screen, 4]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[print-integer screen, 4]</span> <span class="Comment"># run the sandbox</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -239,7 +239,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">65</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -255,7 +255,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes and scroll to second</span> assume-console [ @@ -267,7 +267,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.</span> @@ -282,7 +282,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">2</span>, <span class="Constant">55</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># second sandbox shows in editor; scroll resets to display first sandbox</span> screen-should-contain [ @@ -302,7 +302,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># initialize environment</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> render-all screen, env, render <span class="Comment"># create 2 sandboxes</span> assume-console [ @@ -312,7 +312,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[add 1, 1]</span> press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -331,7 +331,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># no change in contents</span> screen-should-contain [ @@ -353,7 +353,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># screen should show just final sandbox with the right index (1)</span> screen-should-contain [ diff --git a/html/edit/009-sandbox-test.mu.html b/html/edit/009-sandbox-test.mu.html index a2124cd4..ea30b585 100644 --- a/html/edit/009-sandbox-test.mu.html +++ b/html/edit/009-sandbox-test.mu.html @@ -44,12 +44,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> reply 4</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes:text, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes:text, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -65,7 +65,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">5</span>, <span class="Constant">51</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># color toggles to green</span> screen-should-contain-in-color <span class="Constant">2/green</span>, [ @@ -81,7 +81,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># cursor should remain unmoved</span> run [ cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -104,7 +104,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># result turns red</span> screen-should-contain-in-color <span class="Constant">1/red</span>, [ diff --git a/html/edit/010-sandbox-trace.mu.html b/html/edit/010-sandbox-trace.mu.html index 599f69b3..5fb46b84 100644 --- a/html/edit/010-sandbox-trace.mu.html +++ b/html/edit/010-sandbox-trace.mu.html @@ -44,12 +44,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> stash [abc]</span> ]] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -64,9 +64,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">4</span>, <span class="Constant">51</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char<span class="Special"> <- </span>copy <span class="Constant">9251/␣</span> - print screen:&:screen, cursor + print screen, cursor ] <span class="Comment"># trace now printed and cursor shouldn't have budged</span> screen-should-contain [ @@ -90,8 +90,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">4</span>, <span class="Constant">55</span> ] run [ - event-loop screen:&:screen, console:&:console, env - print screen:&:screen, cursor + event-loop screen, console, env + print screen, cursor ] <span class="Comment"># trace hidden again</span> screen-should-contain [ @@ -115,12 +115,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant"> stash [abc]</span> <span class="muControl">reply</span> <span class="Constant">4</span> ]] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run it</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -136,7 +136,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">4</span>, <span class="Constant">51</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># trace now printed above result</span> screen-should-contain [ @@ -157,13 +157,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[stash 123456789]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[stash 123456789]</span> <span class="Comment"># create and expand the trace</span> assume-console [ press F4 left-click <span class="Constant">4</span>, <span class="Constant">51</span> ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -177,7 +177,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">5</span>, <span class="Constant">57</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># no change; doesn't die</span> screen-should-contain [ diff --git a/html/edit/011-errors.mu.html b/html/edit/011-errors.mu.html index be2a087f..67c6c5d2 100644 --- a/html/edit/011-errors.mu.html +++ b/html/edit/011-errors.mu.html @@ -157,12 +157,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> get 123:num, foo:offset</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> @@ -193,7 +193,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">80</span> <span class="Comment"># create invalid sandbox 1</span> @@ -204,7 +204,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># status line shows that error is in first sandbox</span> screen-should-contain [ @@ -216,7 +216,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[]</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">80</span> <span class="Comment"># create invalid sandbox 2</span> @@ -230,7 +230,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># status line shows that error is in second sandbox</span> screen-should-contain [ @@ -242,12 +242,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, <span class="Constant">[get foo, x:offset]</span> <span class="Comment"># invalid</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, <span class="Constant">[get foo, x:offset]</span> <span class="Comment"># invalid</span> assume-console [ press F4 <span class="Comment"># generate error</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">58</span> @@ -256,7 +256,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 <span class="Comment"># update sandbox</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># error should disappear</span> screen-should-contain [ @@ -282,11 +282,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">y:&:num <- copy 0</span> <span class="Constant">z <- add x, y</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo 2]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo 2]</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . errors found (0) run (F4) .</span> <span class="Constant"> .recipe foo x:_elem -> z:_elem [ ┊ .</span> @@ -303,7 +303,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># error should remain unchanged</span> screen-should-contain [ @@ -329,12 +329,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># call code that uses other variants of it, but not it itself</span> sandbox:text<span class="Special"> <- </span>new <span class="Constant">[x:&:list:num <- copy 0</span> <span class="Constant">to-text x]</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, sandbox + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, sandbox <span class="Comment"># run it once</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env <span class="Comment"># no errors anywhere on screen (can't check anything else, since to-text will return an address)</span> screen-should-contain-in-color <span class="Constant">1/red</span>, [ <span class="Constant"> . .</span> @@ -358,7 +358,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># still no errors</span> screen-should-contain-in-color <span class="Constant">1/red</span>, [ @@ -388,12 +388,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo [</span> <span class="Constant"> x <- copy 0</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> @@ -414,12 +414,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">recipe foo \\[</span> <span class="Constant"> x <- copy 0</span> <span class="Constant">]</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> @@ -443,12 +443,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant"> x:&:point <- new point:type</span> <span class="Constant"> get x:&:point, 1:offset</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> @@ -476,12 +476,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant"> y:&:point <- new point:type</span> <span class="Constant"> get *y:&:point, x:num</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> @@ -509,11 +509,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant"> local-scope</span> <span class="Constant"> x:num <- copy y:num</span> <span class="Constant">]</span>] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> <span class="Constant"> . ┊foo .</span> @@ -530,7 +530,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found run (F4) .</span> @@ -551,13 +551,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># right editor contains an illegal instruction</span> sandbox:text<span class="Special"> <- </span>new <span class="Constant">[get 1234:num, foo:offset]</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, sandbox + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, sandbox <span class="Comment"># run the code in the editors</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># check that screen prints error message in red</span> screen-should-contain [ @@ -613,14 +613,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span> <span class="Comment"># right editor contains an illegal instruction</span> sandbox:text<span class="Special"> <- </span>new <span class="Constant">[get 1234:num, foo:offset]</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">[]</span>, sandbox + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, <span class="Constant">[]</span>, sandbox <span class="Comment"># run the code in the editors multiple times</span> assume-console [ press F4 press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># check that screen prints error message just once</span> screen-should-contain [ @@ -648,13 +648,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant"> }</span> <span class="Constant">]</span>] <span class="Comment"># right editor contains an instruction</span> - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo]</span> <span class="Comment"># run the sandbox</span> assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ <span class="Constant"> . errors found (0) run (F4) .</span> @@ -681,12 +681,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color _, c:num<span class="Special"> <- </span>divide-with-remainder a, b <span class="muControl">reply</span> b ]] - env:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, recipes, <span class="Constant">[foo 4, 0]</span> + env:&:environment<span class="Special"> <- </span>new-programming-environment screen, recipes, <span class="Constant">[foo 4, 0]</span> <span class="Comment"># run</span> assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env <span class="Comment"># screen prints error message</span> screen-should-contain [ <span class="Constant"> . errors found (0) run (F4) .</span> @@ -704,7 +704,7 @@ _, c:num<span class="Special"> <- </span>divide-with-remainder a, b left-click <span class="Constant">4</span>, <span class="Constant">55</span> ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] <span class="Comment"># screen should expand trace</span> screen-should-contain [ diff --git a/html/edit/012-editor-undo.mu.html b/html/edit/012-editor-undo.mu.html index 38ab0f2d..c4ea79ee 100644 --- a/html/edit/012-editor-undo.mu.html +++ b/html/edit/012-editor-undo.mu.html @@ -137,18 +137,18 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor and type a character</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ type <span class="Constant">[0]</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># character should be gone</span> screen-should-contain [ @@ -162,7 +162,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -267,18 +267,18 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor and type multiple characters</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ type <span class="Constant">[012]</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># all characters must be gone</span> screen-should-contain [ @@ -293,13 +293,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor with some text</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[a]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[a]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># type some characters</span> assume-console [ type <span class="Constant">[012]</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .012a .</span> @@ -311,7 +311,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># back to original text</span> screen-should-contain [ @@ -325,7 +325,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[3]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -339,14 +339,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor with some text</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[ abc]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[ abc]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># new line</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">8</span> press enter ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> . abc .</span> @@ -366,7 +366,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> @@ -386,7 +386,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -402,13 +402,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor, type something, undo</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[a]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[a]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ type <span class="Constant">[012]</span> press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -420,7 +420,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># all characters must be back</span> screen-should-contain [ @@ -434,7 +434,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[3]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -466,13 +466,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor, type something, undo</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ type <span class="Constant">[012]</span> press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> . .</span> @@ -484,7 +484,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># all characters must be back</span> screen-should-contain [ @@ -498,7 +498,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[3]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -515,18 +515,18 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ type <span class="Constant">[1]</span> press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># do some more work</span> assume-console [ type <span class="Constant">[0]</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .0abc .</span> @@ -539,7 +539,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># nothing should happen</span> screen-should-contain [ @@ -555,7 +555,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># insert some text and tabs, hit enter, some more text and tabs</span> assume-console [ @@ -567,7 +567,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press tab type <span class="Constant">[efg]</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> . ab cd .</span> @@ -586,7 +586,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># typing in second line deleted, but not indent</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -607,7 +607,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># indent and newline deleted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -627,7 +627,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># empty screen</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -647,7 +647,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># first line inserted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -667,7 +667,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># newline and indent inserted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -688,7 +688,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># indent and newline deleted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -715,19 +715,19 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">1</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># click undone</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -741,7 +741,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -807,13 +807,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[a</span> <span class="Constant">b</span> <span class="Constant">cdefgh]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">5/right</span> <span class="Comment"># position cursor at end of screen and try to move right</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">3</span> press right-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> <span class="Comment"># screen scrolls</span> @@ -832,7 +832,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moved back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -853,7 +853,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -870,20 +870,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">1</span> press left-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -897,7 +897,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -915,14 +915,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor</span> assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">1</span> press up-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> memory-should-contain [ @@ -934,7 +934,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -948,7 +948,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -966,20 +966,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">1</span> press down-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -993,7 +993,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1014,19 +1014,19 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">d</span> <span class="Constant">e</span> <span class="Constant">f]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># scroll the page</span> assume-console [ press ctrl-f ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen should again show page 1</span> screen-should-contain [ @@ -1048,19 +1048,19 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">d</span> <span class="Constant">e</span> <span class="Constant">f]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># scroll the page</span> assume-console [ press page-down ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen should again show page 1</span> screen-should-contain [ @@ -1082,20 +1082,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">d</span> <span class="Constant">e</span> <span class="Constant">f]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># scroll the page down and up</span> assume-console [ press page-down press ctrl-b ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen should again show page 2</span> screen-should-contain [ @@ -1117,20 +1117,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">d</span> <span class="Constant">e</span> <span class="Constant">f]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># scroll the page down and up</span> assume-console [ press page-down press page-up ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># screen should again show page 2</span> screen-should-contain [ @@ -1149,20 +1149,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor, then to start of line</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">1</span> press ctrl-a ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1176,7 +1176,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1194,20 +1194,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor, then to start of line</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">1</span> press home ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1221,7 +1221,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1239,20 +1239,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor, then to start of line</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">1</span> press ctrl-e ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1266,7 +1266,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1284,20 +1284,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor, then to start of line</span> assume-console [ left-click <span class="Constant">2</span>, <span class="Constant">1</span> press end ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># undo</span> assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves back</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1311,7 +1311,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1329,7 +1329,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># move the cursor</span> assume-console [ @@ -1338,7 +1338,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow press up-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> memory-should-contain [ @@ -1350,7 +1350,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># up-arrow is undone</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1364,7 +1364,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># both right-arrows are undone</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1384,19 +1384,19 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def</span> <span class="Constant">ghi]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ left-click <span class="Constant">3</span>, <span class="Constant">1</span> press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Comment"># redo</span> assume-console [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># cursor moves to left-click</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1410,7 +1410,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1439,14 +1439,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor, type some text, move the cursor, type some more text</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e assume-console [ type <span class="Constant">[abc]</span> left-click <span class="Constant">1</span>, <span class="Constant">1</span> type <span class="Constant">[d]</span> ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> screen-should-contain [ @@ -1464,7 +1464,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1484,7 +1484,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1504,7 +1504,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1524,7 +1524,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1544,7 +1544,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1565,7 +1565,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> ] @@ -1588,7 +1588,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># insert some text and hit backspace</span> assume-console [ @@ -1596,7 +1596,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press backspace press backspace ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -1614,7 +1614,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> @@ -1633,7 +1633,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> @@ -1733,7 +1733,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># insert some text and hit delete and backspace a few times</span> assume-console [ @@ -1744,7 +1744,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press delete press delete ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .af .</span> @@ -1762,7 +1762,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> @@ -1781,7 +1781,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> @@ -1800,7 +1800,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> <span class="Constant">4</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-column:offset</span> @@ -1819,7 +1819,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># first line inserted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1839,7 +1839,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># first line inserted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1859,7 +1859,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># first line inserted</span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>get *e, <span class="Constant">cursor-row:offset</span> @@ -1924,14 +1924,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># insert some text and hit delete and backspace a few times</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">1</span> press ctrl-k ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .a .</span> @@ -1950,7 +1950,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -1970,7 +1970,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># first line inserted</span> screen-should-contain [ @@ -1991,7 +1991,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2027,14 +2027,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> contents:text<span class="Special"> <- </span>new <span class="Constant">[abc</span> <span class="Constant">def]</span> - e:&:editor<span class="Special"> <- </span>new-editor contents, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor contents, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># insert some text and hit delete and backspace a few times</span> assume-console [ left-click <span class="Constant">1</span>, <span class="Constant">2</span> press ctrl-u ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .c .</span> @@ -2053,7 +2053,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2073,7 +2073,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] <span class="Comment"># first line inserted</span> screen-should-contain [ @@ -2094,7 +2094,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ <span class="Constant"> . .</span> @@ -2127,7 +2127,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Comment"># create an editor</span> assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen:&:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> + e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">[]</span>, screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, e <span class="Comment"># insert some text and hit delete and backspace a few times</span> assume-console [ @@ -2135,7 +2135,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press ctrl-u press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ <span class="Constant"> . .</span> <span class="Constant"> .abc .</span> |