diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-28 18:35:39 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-28 18:35:39 -0700 |
commit | e330f8545533d03bfe1a29506f243d4846dbd7c2 (patch) | |
tree | 526edc1f2879a2a1604673febdebcbf80c8ade43 /sandbox | |
parent | 813b93b801dc3c7d36b63b7a3779529a854416a7 (diff) | |
download | mu-e330f8545533d03bfe1a29506f243d4846dbd7c2.tar.gz |
2309
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/001-editor.mu | 34 | ||||
-rw-r--r-- | sandbox/002-typing.mu | 126 | ||||
-rw-r--r-- | sandbox/003-shortcuts.mu | 336 | ||||
-rw-r--r-- | sandbox/004-programming-environment.mu | 22 | ||||
-rw-r--r-- | sandbox/005-sandbox.mu | 30 | ||||
-rw-r--r-- | sandbox/006-sandbox-edit.mu | 14 | ||||
-rw-r--r-- | sandbox/007-sandbox-delete.mu | 8 | ||||
-rw-r--r-- | sandbox/009-sandbox-trace.mu | 18 | ||||
-rw-r--r-- | sandbox/010-warnings.mu | 14 | ||||
-rw-r--r-- | sandbox/011-editor-undo.mu | 246 |
10 files changed, 424 insertions, 424 deletions
diff --git a/sandbox/001-editor.mu b/sandbox/001-editor.mu index 8f41c5c1..f89a6ab9 100644 --- a/sandbox/001-editor.mu +++ b/sandbox/001-editor.mu @@ -17,7 +17,7 @@ scenario editor-initially-prints-string-to-screen [ assume-screen 10/width, 5/height run [ 1:address:array:character <- new [abc] - new-editor 1:address:array:character, screen:address, 0/left, 10/right + new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right ] screen-should-contain [ # top line of screen reserved for menu @@ -44,14 +44,14 @@ container editor-data [ cursor-column:number ] -# editor:address, screen <- new-editor s:address:array:character, screen:address, left:number, right:number +# editor:address:editor-data, screen <- new-editor s:address:array:character, screen:address:screen, left:number, right:number # creates a new editor widget and renders its initial appearance to screen. # top/left/right constrain the screen area available to the new editor. # right is exclusive. recipe new-editor [ local-scope s:address:array:character <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient # no clipping of bounds left:number <- next-ingredient right:number <- next-ingredient @@ -110,7 +110,7 @@ recipe insert-text [ scenario editor-initializes-without-data [ assume-screen 5/width, 3/height run [ - 1:address:editor-data <- new-editor 0/data, screen:address, 2/left, 5/right + 1:address:editor-data <- new-editor 0/data, screen:address:screen, 2/left, 5/right 2:editor-data <- copy *1:address:editor-data ] memory-should-contain [ @@ -130,14 +130,14 @@ scenario editor-initializes-without-data [ ] ] -# last-row:number, last-column:number, screen, editor <- render screen:address, editor:address:editor-data +# last-row:number, last-column:number, screen, editor <- render screen:address:screen, editor:address:editor-data # # Assumes cursor should be at coordinates (cursor-row, cursor-column) and # updates before-cursor to match. Might also move coordinates if they're # outside text. recipe render [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient editor:address:editor-data <- next-ingredient reply-unless editor, 1/top, 0/left, screen/same-as-ingredient:0, editor/same-as-ingredient:1 left:number <- get *editor, left:offset @@ -235,7 +235,7 @@ recipe render [ recipe clear-line-delimited [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient column:number <- next-ingredient right:number <- next-ingredient { @@ -249,7 +249,7 @@ recipe clear-line-delimited [ recipe clear-screen-from [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient row:number <- next-ingredient column:number <- next-ingredient left:number <- next-ingredient @@ -269,7 +269,7 @@ recipe clear-screen-from [ recipe clear-rest-of-screen [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient row:number <- next-ingredient left:number <- next-ingredient right:number <- next-ingredient @@ -291,7 +291,7 @@ scenario editor-initially-prints-multiple-lines [ run [ s:address:array:character <- new [abc def] - new-editor s:address:array:character, screen:address, 0/left, 5/right + new-editor s:address:array:character, screen:address:screen, 0/left, 5/right ] screen-should-contain [ . . @@ -305,7 +305,7 @@ scenario editor-initially-handles-offsets [ assume-screen 5/width, 5/height run [ s:address:array:character <- new [abc] - new-editor s:address:array:character, screen:address, 1/left, 5/right + new-editor s:address:array:character, screen:address:screen, 1/left, 5/right ] screen-should-contain [ . . @@ -319,7 +319,7 @@ scenario editor-initially-prints-multiple-lines-at-offset [ run [ s:address:array:character <- new [abc def] - new-editor s:address:array:character, screen:address, 1/left, 5/right + new-editor s:address:array:character, screen:address:screen, 1/left, 5/right ] screen-should-contain [ . . @@ -333,7 +333,7 @@ scenario editor-initially-wraps-long-lines [ assume-screen 5/width, 5/height run [ s:address:array:character <- new [abc def] - new-editor s:address:array:character, screen:address, 0/left, 5/right + new-editor s:address:array:character, screen:address:screen, 0/left, 5/right ] screen-should-contain [ . . @@ -353,7 +353,7 @@ scenario editor-initially-wraps-barely-long-lines [ assume-screen 5/width, 5/height run [ s:address:array:character <- new [abcde] - new-editor s:address:array:character, screen:address, 0/left, 5/right + new-editor s:address:array:character, screen:address:screen, 0/left, 5/right ] # still wrap, even though the line would fit. We need room to click on the # end of the line @@ -375,7 +375,7 @@ scenario editor-initializes-empty-text [ assume-screen 5/width, 5/height run [ 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -398,7 +398,7 @@ scenario render-colors-comments [ s:address:array:character <- new [abc # de f] - new-editor s:address:array:character, screen:address, 0/left, 5/right + new-editor s:address:array:character, screen:address:screen, 0/left, 5/right ] screen-should-contain [ . . @@ -481,7 +481,7 @@ scenario render-colors-assignment [ s:address:array:character <- new [abc d <- e f] - new-editor s:address:array:character, screen:address, 0/left, 8/right + new-editor s:address:array:character, screen:address:screen, 0/left, 8/right ] screen-should-contain [ . . diff --git a/sandbox/002-typing.mu b/sandbox/002-typing.mu index 463b413d..45eaaa89 100644 --- a/sandbox/002-typing.mu +++ b/sandbox/002-typing.mu @@ -13,8 +13,8 @@ recipe! main [ recipe editor-event-loop [ local-scope - screen:address <- next-ingredient - console:address <- next-ingredient + screen:address:screen <- next-ingredient + console:address:console <- next-ingredient editor:address:editor-data <- next-ingredient { # looping over each (keyboard or touch) event as it occurs @@ -22,7 +22,7 @@ recipe editor-event-loop [ cursor-row:number <- get *editor, cursor-row:offset cursor-column:number <- get *editor, cursor-column:offset screen <- move-cursor screen, cursor-row, cursor-column - e:event, console:address, found?:boolean, quit?:boolean <- read-event console + e:event, console:address:console, found?:boolean, quit?:boolean <- read-event console loop-unless found? break-if quit? # only in tests trace 10, [app], [next-event] @@ -49,7 +49,7 @@ recipe editor-event-loop [ # process click, return if it was on current editor recipe move-cursor-in-editor [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient editor:address:editor-data <- next-ingredient t:touch-event <- next-ingredient reply-unless editor, 0/false @@ -71,14 +71,14 @@ recipe move-cursor-in-editor [ reply 1/true ] -# editor <- snap-cursor screen:address, editor:address:editor-data, target-row:number, target-column:number +# editor <- snap-cursor screen:address:screen, editor:address:editor-data, target-row:number, target-column:number # # Variant of 'render' that only moves the cursor (coordinates and # before-cursor). If it's past the end of a line, it 'slides' it left. If it's # past the last line it positions at end of last line. recipe snap-cursor [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient editor:address:editor-data <- next-ingredient target-row:number <- next-ingredient target-column:number <- next-ingredient @@ -163,12 +163,12 @@ recipe snap-cursor [ reply editor/same-as-ingredient:1 ] -# screen, editor, go-render?:boolean <- handle-keyboard-event screen:address, editor:address:editor-data, e:event +# screen, editor, go-render?:boolean <- handle-keyboard-event screen:address:screen, editor:address:editor-data, e:event # Process an event 'e' and try to minimally update the screen. # Set 'go-render?' to true to indicate the caller must perform a non-minimal update. recipe handle-keyboard-event [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient editor:address:editor-data <- next-ingredient e:event <- next-ingredient reply-unless editor, screen/same-as-ingredient:0, editor/same-as-ingredient:1, 0/no-more-render @@ -209,7 +209,7 @@ recipe insert-at-cursor [ local-scope editor:address:editor-data <- next-ingredient c:character <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient before-cursor:address:address:duplex-list <- get-address *editor, before-cursor:offset insert-duplex c, *before-cursor *before-cursor <- next-duplex *before-cursor @@ -269,7 +269,7 @@ recipe insert-at-cursor [ # helper for tests recipe editor-render [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient editor:address:editor-data <- next-ingredient left:number <- get *editor, left:offset right:number <- get *editor, right:offset @@ -284,11 +284,11 @@ recipe editor-render [ scenario editor-handles-empty-event-queue [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -301,14 +301,14 @@ scenario editor-handles-empty-event-queue [ scenario editor-handles-mouse-clicks [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ left-click 1, 1 # on the 'b' ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -328,13 +328,13 @@ scenario editor-handles-mouse-clicks [ scenario editor-handles-mouse-clicks-outside-text [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right $clear-trace assume-console [ left-click 1, 7 # last line, to the right of text ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -349,13 +349,13 @@ scenario editor-handles-mouse-clicks-outside-text-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right $clear-trace assume-console [ left-click 1, 7 # interior line, to the right of text ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -370,13 +370,13 @@ scenario editor-handles-mouse-clicks-outside-text-3 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right $clear-trace assume-console [ left-click 3, 7 # below text ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -391,7 +391,7 @@ scenario editor-handles-mouse-clicks-outside-column [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] # editor occupies only left half of screen - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -399,7 +399,7 @@ scenario editor-handles-mouse-clicks-outside-column [ left-click 3, 8 ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -419,7 +419,7 @@ scenario editor-handles-mouse-clicks-outside-column [ scenario editor-handles-mouse-clicks-in-menu-area [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -427,7 +427,7 @@ scenario editor-handles-mouse-clicks-in-menu-area [ left-click 0, 3 ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -441,14 +441,14 @@ scenario editor-handles-mouse-clicks-in-menu-area [ scenario editor-inserts-characters-into-empty-editor [ assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ type [abc] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -462,7 +462,7 @@ scenario editor-inserts-characters-into-empty-editor [ scenario editor-inserts-characters-at-cursor [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # type two letters at different places @@ -472,7 +472,7 @@ scenario editor-inserts-characters-at-cursor [ type [d] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -486,7 +486,7 @@ scenario editor-inserts-characters-at-cursor [ scenario editor-inserts-characters-at-cursor-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -494,7 +494,7 @@ scenario editor-inserts-characters-at-cursor-2 [ type [d] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -509,7 +509,7 @@ scenario editor-inserts-characters-at-cursor-5 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -517,7 +517,7 @@ d] type [e] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -532,7 +532,7 @@ d] scenario editor-inserts-characters-at-cursor-3 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -540,7 +540,7 @@ scenario editor-inserts-characters-at-cursor-3 [ type [d] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -555,7 +555,7 @@ scenario editor-inserts-characters-at-cursor-4 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -563,7 +563,7 @@ d] type [e] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -579,7 +579,7 @@ scenario editor-inserts-characters-at-cursor-6 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -587,7 +587,7 @@ d] type [ef] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -602,13 +602,13 @@ d] scenario editor-moves-cursor-after-inserting-characters [ assume-screen 10/width, 5/height 1:address:array:character <- new [ab] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data assume-console [ type [01] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -623,14 +623,14 @@ scenario editor-moves-cursor-after-inserting-characters [ scenario editor-wraps-line-on-insert [ assume-screen 5/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data # type a letter assume-console [ type [e] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # no wrap yet screen-should-contain [ @@ -645,7 +645,7 @@ scenario editor-wraps-line-on-insert [ type [f] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # now wrap screen-should-contain [ @@ -662,7 +662,7 @@ scenario editor-wraps-line-on-insert-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcdefg defg] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data # type more text at the start assume-console [ @@ -670,7 +670,7 @@ defg] type [abc] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -712,13 +712,13 @@ after <insert-character-special-case> [ scenario editor-wraps-cursor-after-inserting-characters [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right assume-console [ left-click 1, 4 # line is full; no wrap icon yet type [f] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -738,13 +738,13 @@ scenario editor-wraps-cursor-after-inserting-characters [ scenario editor-wraps-cursor-after-inserting-characters-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right assume-console [ left-click 1, 3 # right before the wrap icon type [f] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -764,13 +764,13 @@ scenario editor-wraps-cursor-after-inserting-characters-2 [ scenario editor-wraps-cursor-to-left-margin [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 2/left, 7/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 2/left, 7/right assume-console [ left-click 1, 5 # line is full; no wrap icon yet type [01] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -801,13 +801,13 @@ after <editor-initialization> [ scenario editor-moves-cursor-down-after-inserting-newline [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right assume-console [ type [0 1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -832,7 +832,7 @@ after <handle-special-character> [ recipe insert-new-line-and-indent [ local-scope editor:address:editor-data <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient cursor-row:address:number <- get-address *editor, cursor-row:offset cursor-column:address:number <- get-address *editor, cursor-column:offset before-cursor:address:address:duplex-list <- get-address *editor, before-cursor:offset @@ -905,13 +905,13 @@ recipe line-indent [ scenario editor-moves-cursor-down-after-inserting-newline-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 1/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 1/left, 10/right assume-console [ type [0 1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -925,7 +925,7 @@ scenario editor-moves-cursor-down-after-inserting-newline-2 [ scenario editor-clears-previous-line-completely-after-inserting-newline [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right assume-console [ press enter ] @@ -937,7 +937,7 @@ scenario editor-clears-previous-line-completely-after-inserting-newline [ . . ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # line should be fully cleared screen-should-contain [ @@ -954,7 +954,7 @@ scenario editor-inserts-indent-after-newline [ 1:address:array:character <- new [ab cd ef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' assume-console [ left-click 2, 8 @@ -962,7 +962,7 @@ ef] ] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -978,7 +978,7 @@ scenario editor-skips-indent-around-paste [ 1:address:array:character <- new [ab cd ef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' surrounded by paste markers assume-console [ left-click 2, 8 @@ -987,7 +987,7 @@ ef] press 65506 # end paste ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1022,7 +1022,7 @@ after <handle-special-key> [ recipe draw-horizontal [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient row:number <- next-ingredient x:number <- next-ingredient right:number <- next-ingredient diff --git a/sandbox/003-shortcuts.mu b/sandbox/003-shortcuts.mu index fe6156a1..ac5b468e 100644 --- a/sandbox/003-shortcuts.mu +++ b/sandbox/003-shortcuts.mu @@ -9,12 +9,12 @@ scenario editor-inserts-two-spaces-on-tab [ # just one character in final line 1:address:array:character <- new [ab cd] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right assume-console [ press tab ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -40,7 +40,7 @@ after <handle-special-character> [ scenario editor-handles-backspace-key [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -48,7 +48,7 @@ scenario editor-handles-backspace-key [ press backspace ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -83,7 +83,7 @@ after <handle-special-character> [ recipe delete-before-cursor [ local-scope editor:address:editor-data <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient before-cursor:address:address:duplex-list <- get-address *editor, before-cursor:offset # if at start of text (before-cursor at § sentinel), return prev:address:duplex-list <- prev-duplex *before-cursor @@ -200,13 +200,13 @@ scenario editor-clears-last-line-on-backspace [ # just one character in final line 1:address:array:character <- new [ab cd] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right assume-console [ left-click 2, 0 # cursor at only character in final line press backspace ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -227,14 +227,14 @@ cd] scenario editor-handles-delete-key [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ press delete ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -248,7 +248,7 @@ scenario editor-handles-delete-key [ press delete ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -273,7 +273,7 @@ after <handle-special-key> [ recipe delete-at-cursor [ local-scope editor:address:editor-data <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient before-cursor:address:address:duplex-list <- get-address *editor, before-cursor:offset candidate:address:duplex-list <- next-duplex *before-cursor reply-unless candidate, editor/same-as-ingredient:0, screen/same-as-ingredient:1, 0/no-more-render, 0/nothing-deleted @@ -312,7 +312,7 @@ recipe delete-at-cursor [ scenario editor-moves-cursor-right-with-key [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -320,7 +320,7 @@ scenario editor-moves-cursor-right-with-key [ type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -400,7 +400,7 @@ scenario editor-moves-cursor-to-next-line-with-right-arrow [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # type right-arrow a few times to get to start of second line @@ -411,7 +411,7 @@ d] press right-arrow # next line ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] check-trace-count-for-label 0, [print-character] # type something and ensure it goes where it should @@ -419,7 +419,7 @@ d] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -435,7 +435,7 @@ scenario editor-moves-cursor-to-next-line-with-right-arrow-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 1/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 1/left, 10/right editor-render screen, 2:address:editor-data assume-console [ press right-arrow @@ -445,7 +445,7 @@ d] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -459,7 +459,7 @@ d] scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -467,7 +467,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ press right-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -489,7 +489,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ assume-screen 10/width, 5/height # line just barely wrapping 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace # position cursor at last character before wrap and hit right-arrow @@ -498,7 +498,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ press right-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -511,7 +511,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ press right-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -525,7 +525,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abcdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 1/left, 6/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 1/left, 6/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -533,7 +533,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [ press right-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -555,7 +555,7 @@ scenario editor-moves-cursor-to-next-line-with-right-arrow-at-end-of-line [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # move to end of line, press right-arrow, type a character @@ -565,7 +565,7 @@ d] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # new character should be in next line screen-should-contain [ @@ -585,7 +585,7 @@ d] scenario editor-moves-cursor-left-with-key [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -594,7 +594,7 @@ scenario editor-moves-cursor-left-with-key [ type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -627,7 +627,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line [ # initialize editor with two lines 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor at start of second line (so there's no previous newline) @@ -636,7 +636,7 @@ d] press left-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -653,7 +653,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-2 1:address:array:character <- new [abc def g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor further down (so there's a newline before the character at @@ -664,7 +664,7 @@ g] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -681,7 +681,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-3 1:address:array:character <- new [abc def g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor at start of text, press left-arrow, then type a character @@ -691,7 +691,7 @@ g] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # left-arrow should have had no effect screen-should-contain [ @@ -710,7 +710,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-4 1:address:array:character <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor right after empty line @@ -720,7 +720,7 @@ d] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -736,7 +736,7 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [ assume-screen 10/width, 5/height # initialize editor with text containing an empty line 1:address:array:character <- new [abcdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace screen-should-contain [ @@ -752,7 +752,7 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [ press left-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -771,7 +771,7 @@ scenario editor-moves-to-previous-line-with-up-arrow [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -779,7 +779,7 @@ def] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -792,7 +792,7 @@ def] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -878,7 +878,7 @@ scenario editor-adjusts-column-at-previous-line [ assume-screen 10/width, 5/height 1:address:array:character <- new [ab def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -886,7 +886,7 @@ def] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -899,7 +899,7 @@ def] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -914,7 +914,7 @@ scenario editor-adjusts-column-at-empty-line [ assume-screen 10/width, 5/height 1:address:array:character <- new [ def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -922,7 +922,7 @@ def] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -935,7 +935,7 @@ def] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -952,7 +952,7 @@ scenario editor-moves-to-previous-line-from-left-margin [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # click on the third line and hit up-arrow, so you end up just after a newline @@ -961,7 +961,7 @@ ghi] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -974,7 +974,7 @@ ghi] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -991,7 +991,7 @@ scenario editor-moves-to-next-line-with-down-arrow [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # cursor starts out at (1, 0) @@ -999,7 +999,7 @@ def] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1013,7 +1013,7 @@ def] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1090,7 +1090,7 @@ scenario editor-adjusts-column-at-next-line [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc de] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -1098,7 +1098,7 @@ de] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1111,7 +1111,7 @@ de] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1126,7 +1126,7 @@ scenario editor-scrolls-at-end-on-down-arrow [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc de] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # try to move down past end of text @@ -1135,7 +1135,7 @@ de] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1148,7 +1148,7 @@ de] type [0] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1163,7 +1163,7 @@ de] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1177,7 +1177,7 @@ de] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1193,7 +1193,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on second line, press ctrl-a @@ -1202,7 +1202,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a [ press ctrl-a ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1265,7 +1265,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line (no newline before), press ctrl-a @@ -1274,7 +1274,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [ press ctrl-a ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1290,7 +1290,7 @@ scenario editor-moves-to-start-of-line-with-home [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right $clear-trace # start on second line, press 'home' assume-console [ @@ -1298,7 +1298,7 @@ scenario editor-moves-to-start-of-line-with-home [ press home ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1314,7 +1314,7 @@ scenario editor-moves-to-start-of-line-with-home-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line (no newline before), press 'home' @@ -1323,7 +1323,7 @@ scenario editor-moves-to-start-of-line-with-home-2 [ press home ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1341,7 +1341,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line, press ctrl-e @@ -1350,7 +1350,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [ press ctrl-e ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1365,7 +1365,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [ type [z] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1429,7 +1429,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on second line (no newline after), press ctrl-e @@ -1438,7 +1438,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [ press ctrl-e ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 4:number <- get *2:address:editor-data, cursor-row:offset 5:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1454,7 +1454,7 @@ scenario editor-moves-to-end-of-line-with-end [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line, press 'end' @@ -1463,7 +1463,7 @@ scenario editor-moves-to-end-of-line-with-end [ press end ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1479,7 +1479,7 @@ scenario editor-moves-to-end-of-line-with-end-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on second line (no newline after), press 'end' @@ -1488,7 +1488,7 @@ scenario editor-moves-to-end-of-line-with-end-2 [ press end ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1506,14 +1506,14 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start on second line, press ctrl-u assume-console [ left-click 2, 2 press ctrl-u ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes to start of line screen-should-contain [ @@ -1569,14 +1569,14 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start on first line (no newline before), press ctrl-u assume-console [ left-click 1, 2 press ctrl-u ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes to start of line screen-should-contain [ @@ -1592,14 +1592,14 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-3 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start past end of line, press ctrl-u assume-console [ left-click 1, 3 press ctrl-u ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes to start of line screen-should-contain [ @@ -1615,14 +1615,14 @@ scenario editor-deletes-to-start-of-final-line-with-ctrl-u [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start past end of final line, press ctrl-u assume-console [ left-click 2, 3 press ctrl-u ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes to start of line screen-should-contain [ @@ -1640,14 +1640,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start on first line, press ctrl-k assume-console [ left-click 1, 1 press ctrl-k ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes to end of line screen-should-contain [ @@ -1695,14 +1695,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-2 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start on second line (no newline after), press ctrl-k assume-console [ left-click 2, 1 press ctrl-k ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes to end of line screen-should-contain [ @@ -1718,14 +1718,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-3 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start at end of line assume-console [ left-click 1, 2 press ctrl-k ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes just last character screen-should-contain [ @@ -1741,14 +1741,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-4 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start past end of line assume-console [ left-click 1, 3 press ctrl-k ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes nothing screen-should-contain [ @@ -1764,14 +1764,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-5 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start at end of text assume-console [ left-click 2, 2 press ctrl-k ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes just the final character screen-should-contain [ @@ -1787,14 +1787,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-6 [ assume-screen 10/width, 5/height 1:address:array:character <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right # start past end of text assume-console [ left-click 2, 3 press ctrl-k ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # cursor deletes nothing screen-should-contain [ @@ -1816,7 +1816,7 @@ scenario editor-can-scroll-down-using-arrow-keys [ b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -1829,7 +1829,7 @@ d] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen slides by one line screen-should-contain [ @@ -1897,7 +1897,7 @@ scenario editor-scrolls-down-past-wrapped-line-using-arrow-keys [ g h i] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right screen-should-contain [ . . .abcd↩ . @@ -1910,7 +1910,7 @@ i] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -1929,14 +1929,14 @@ scenario editor-scrolls-down-past-wrapped-line-using-arrow-keys-2 [ k l m] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at last line, then try to move further down assume-console [ left-click 3, 0 press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line containing a wrap icon screen-should-contain [ @@ -1950,7 +1950,7 @@ m] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -1968,14 +1968,14 @@ scenario editor-scrolls-down-when-line-wraps [ 1:address:array:character <- new [a b cdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at end, type a character assume-console [ left-click 3, 4 type [g] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1998,14 +1998,14 @@ scenario editor-scrolls-down-on-newline [ 1:address:array:character <- new [a b c] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right assume-console [ left-click 3, 4 type [ ] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -2029,14 +2029,14 @@ scenario editor-scrolls-down-on-right-arrow [ 1:address:array:character <- new [a b cdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at end of screen and try to move right assume-console [ left-click 3, 3 press right-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -2061,14 +2061,14 @@ scenario editor-scrolls-down-on-right-arrow-2 [ b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at end of screen and try to move right assume-console [ left-click 3, 3 press right-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -2096,7 +2096,7 @@ d e f g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # scroll down one page and one line assume-console [ press page-down @@ -2104,7 +2104,7 @@ g] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen scrolls down 3 lines screen-should-contain [ @@ -2125,7 +2125,7 @@ scenario editor-can-scroll-up-using-arrow-keys [ b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2138,7 +2138,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen slides by one line screen-should-contain [ @@ -2211,7 +2211,7 @@ scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys [ g h i] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right screen-should-contain [ . . .abcd↩ . @@ -2223,7 +2223,7 @@ i] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2236,7 +2236,7 @@ i] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -2255,13 +2255,13 @@ scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-2 [ k l m] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at top of second page assume-console [ press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2275,7 +2275,7 @@ m] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -2290,7 +2290,7 @@ m] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -2305,7 +2305,7 @@ m] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -2328,7 +2328,7 @@ scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-3 [ g h i] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 6/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 6/right screen-should-contain [ . . .abcde↩ . @@ -2340,7 +2340,7 @@ i] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2353,7 +2353,7 @@ i] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows partial wrapped line screen-should-contain [ @@ -2374,12 +2374,12 @@ b c d e] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 6/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 6/right assume-console [ press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2391,7 +2391,7 @@ e] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2403,7 +2403,7 @@ e] press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2422,13 +2422,13 @@ b c d e] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at top of second page assume-console [ press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2441,7 +2441,7 @@ e] press left-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -2466,7 +2466,7 @@ scenario editor-can-scroll-up-to-start-of-file [ b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2481,7 +2481,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen slides by one line screen-should-contain [ @@ -2495,7 +2495,7 @@ d] press up-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen remains unchanged screen-should-contain [ @@ -2514,7 +2514,7 @@ scenario editor-can-scroll [ b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2526,7 +2526,7 @@ d] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows next page screen-should-contain [ @@ -2598,7 +2598,7 @@ scenario editor-does-not-scroll-past-end [ assume-screen 10/width, 4/height 1:address:array:character <- new [a b] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data screen-should-contain [ . . @@ -2611,7 +2611,7 @@ b] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen remains unmodified screen-should-contain [ @@ -2630,7 +2630,7 @@ scenario editor-starts-next-page-at-start-of-wrapped-line [ b cdefgh] # editor screen triggers wrap of last line - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -2643,7 +2643,7 @@ cdefgh] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows entire wrapped line screen-should-contain [ @@ -2661,7 +2661,7 @@ scenario editor-starts-next-page-at-start-of-wrapped-line-2 [ # and still has something left over 1:address:array:character <- new [a bcdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -2674,7 +2674,7 @@ bcdefgh] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows entire wrapped line screen-should-contain [ @@ -2693,7 +2693,7 @@ scenario editor-can-scroll-up [ b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2705,7 +2705,7 @@ d] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows next page screen-should-contain [ @@ -2719,7 +2719,7 @@ d] press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows original page again screen-should-contain [ @@ -2794,7 +2794,7 @@ e f g h] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2807,7 +2807,7 @@ h] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows third page screen-should-contain [ @@ -2821,7 +2821,7 @@ h] press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows second page screen-should-contain [ @@ -2835,7 +2835,7 @@ h] press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows original page again screen-should-contain [ @@ -2861,7 +2861,7 @@ m n o] # editor screen triggers wrap of last line - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -2878,7 +2878,7 @@ o] press down-arrow ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows entire wrapped line screen-should-contain [ @@ -2894,7 +2894,7 @@ o] press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen resets screen-should-contain [ @@ -2914,7 +2914,7 @@ scenario editor-can-scroll-up-wrapped-lines-2 [ # and still has something left over 1:address:array:character <- new [a bcdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -2927,7 +2927,7 @@ bcdefgh] press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen shows entire wrapped line screen-should-contain [ @@ -2941,7 +2941,7 @@ bcdefgh] press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # screen resets screen-should-contain [ @@ -2964,7 +2964,7 @@ fxx gxx hxx ] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right screen-should-contain [ . . .axx . @@ -2975,7 +2975,7 @@ hxx press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2987,7 +2987,7 @@ hxx press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -3000,7 +3000,7 @@ hxx press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -3022,7 +3022,7 @@ exy fxy gxy ] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right screen-should-contain [ . . .axy . @@ -3033,7 +3033,7 @@ gxy press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -3045,7 +3045,7 @@ gxy press page-down ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -3058,7 +3058,7 @@ gxy press page-up ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu index 06bdbb36..a405c173 100644 --- a/sandbox/004-programming-environment.mu +++ b/sandbox/004-programming-environment.mu @@ -21,7 +21,7 @@ container programming-environment-data [ recipe new-programming-environment [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient initial-sandbox-contents:address:array:character <- next-ingredient width:number <- screen-width screen height:number <- screen-height screen @@ -43,8 +43,8 @@ recipe new-programming-environment [ recipe event-loop [ local-scope - screen:address <- next-ingredient - console:address <- next-ingredient + screen:address:screen <- next-ingredient + console:address:console <- next-ingredient env:address:programming-environment-data <- next-ingredient current-sandbox:address:editor-data <- get *env, current-sandbox:offset # if we fall behind we'll stop updating the screen, but then we have to @@ -142,7 +142,7 @@ recipe event-loop [ recipe resize [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient env:address:programming-environment-data <- next-ingredient clear-screen screen # update screen dimensions width:number <- screen-width screen @@ -160,7 +160,7 @@ recipe resize [ recipe render-all [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient env:address:programming-environment-data <- next-ingredient trace 10, [app], [render all] hide-screen screen @@ -188,7 +188,7 @@ recipe render-all [ # replaced in a later layer recipe render-sandbox-side [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient env:address:programming-environment-data <- next-ingredient current-sandbox:address:editor-data <- get *env, current-sandbox:offset left:number <- get *current-sandbox, left:offset @@ -205,7 +205,7 @@ recipe render-sandbox-side [ recipe update-cursor [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient current-sandbox:address:editor-data <- next-ingredient cursor-row:number <- get *current-sandbox, cursor-row:offset cursor-column:number <- get *current-sandbox, cursor-column:offset @@ -213,12 +213,12 @@ recipe update-cursor [ reply screen/same-as-ingredient:0 ] -# row, screen <- render-string screen:address, s:address:array:character, left:number, right:number, color:number, row:number +# row, screen <- render-string screen:address:screen, s:address:array:character, left:number, right:number, color:number, row:number # print a string 's' to 'editor' in 'color' starting at 'row' # clear rest of last line, move cursor to next line recipe render-string [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient s:address:array:character <- next-ingredient left:number <- next-ingredient right:number <- next-ingredient @@ -280,11 +280,11 @@ recipe render-string [ reply row/same-as-ingredient:5, screen/same-as-ingredient:0 ] -# row, screen <- render-code-string screen:address, s:address:array:character, left:number, right:number, row:number +# row, screen <- render-code-string screen:address:screen, s:address:array:character, left:number, right:number, row:number # like 'render-string' but with colorization for comments like in the editor recipe render-code-string [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient s:address:array:character <- next-ingredient left:number <- next-ingredient right:number <- next-ingredient diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index 34b446a1..91bbc1f0 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -25,13 +25,13 @@ scenario run-and-show-results [ assume-screen 50/width, 15/height # sandbox editor contains an instruction without storing outputs 1:address:array:character <- new [divide-with-remainder 11, 3] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character # run the code in the editors assume-console [ press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] # check that screen prints the results screen-should-contain [ @@ -74,7 +74,7 @@ scenario run-and-show-results [ press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] # check that screen prints both sandboxes screen-should-contain [ @@ -117,7 +117,7 @@ after <global-keypress> [ recipe run-sandboxes [ local-scope env:address:programming-environment-data <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient stop?:boolean, env, screen <- update-recipes env, screen reply-if stop?, 1/errors-found, env/same-as-ingredient:0, screen/same-as-ingredient:1 # check contents of editor @@ -159,7 +159,7 @@ recipe run-sandboxes [ recipe update-recipes [ local-scope env:address:programming-environment-data <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient in:address:array:character <- restore [recipes.mu] # newlayer: persistence reload in reply 0/no-errors-found, env/same-as-ingredient:0, screen/same-as-ingredient:1 @@ -177,7 +177,7 @@ recipe update-sandbox [ recipe update-status [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient msg:address:array:character <- next-ingredient color:number <- next-ingredient screen <- move-cursor screen, 0, 2 @@ -213,7 +213,7 @@ recipe save-sandboxes [ recipe! render-sandbox-side [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient env:address:programming-environment-data <- next-ingredient trace 11, [app], [render sandbox side] current-sandbox:address:editor-data <- get *env, current-sandbox:offset @@ -231,7 +231,7 @@ recipe! render-sandbox-side [ recipe render-sandboxes [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient sandbox:address:sandbox-data <- next-ingredient left:number <- next-ingredient right:number <- next-ingredient @@ -261,7 +261,7 @@ recipe render-sandboxes [ sandbox-response:address:array:character <- get *sandbox, response:offset <render-sandbox-results> { - sandbox-screen:address <- get *sandbox, screen:offset + sandbox-screen:address:screen <- get *sandbox, screen:offset empty-screen?:boolean <- fake-screen-is-empty? sandbox-screen break-if empty-screen? row, screen <- render-screen screen, sandbox-screen, left, right, row @@ -315,12 +315,12 @@ recipe restore-sandboxes [ reply env/same-as-ingredient:0 ] -# row, screen <- render-screen screen:address, sandbox-screen:address, left:number, right:number, row:number +# row, screen <- render-screen screen:address:screen, sandbox-screen:address:screen, left:number, right:number, row:number # print the fake sandbox screen to 'screen' with appropriate delimiters # leave cursor at start of next line recipe render-screen [ local-scope - screen:address <- next-ingredient + screen:address:screen <- next-ingredient s:address:screen <- next-ingredient left:number <- next-ingredient right:number <- next-ingredient @@ -392,13 +392,13 @@ scenario run-instruction-manages-screen-per-sandbox [ assume-screen 50/width, 20/height # editor contains an instruction 1:address:array:character <- new [print-integer screen, 4] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character # run the code in the editor assume-console [ press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] # check that it prints a little toy screen screen-should-contain [ @@ -441,13 +441,13 @@ recipe editor-contents [ scenario editor-provides-edited-contents [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right assume-console [ left-click 1, 2 type [def] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:address:array:character <- editor-contents 2:address:editor-data 4:array:character <- copy *3:address:array:character ] diff --git a/sandbox/006-sandbox-edit.mu b/sandbox/006-sandbox-edit.mu index db12cc57..4f76b124 100644 --- a/sandbox/006-sandbox-edit.mu +++ b/sandbox/006-sandbox-edit.mu @@ -8,8 +8,8 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ assume-console [ press F4 ] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character - event-loop screen:address, console:address, 2:address:programming-environment-data + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data screen-should-contain [ . run (F4) . . . @@ -27,7 +27,7 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ left-click 3, 0 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] # it pops back into editor screen-should-contain [ @@ -47,7 +47,7 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ type [0] ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . @@ -129,13 +129,13 @@ scenario sandbox-with-print-can-be-edited [ assume-screen 50/width, 20/height # run a print instruction 1:address:array:character <- new [print-integer screen, 4] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character # run the sandbox assume-console [ press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . @@ -164,7 +164,7 @@ scenario sandbox-with-print-can-be-edited [ left-click 3, 70 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . diff --git a/sandbox/007-sandbox-delete.mu b/sandbox/007-sandbox-delete.mu index 224ac923..a3ef543e 100644 --- a/sandbox/007-sandbox-delete.mu +++ b/sandbox/007-sandbox-delete.mu @@ -4,7 +4,7 @@ scenario deleting-sandboxes [ trace-until 100/app # trace too long assume-screen 50/width, 15/height 1:address:array:character <- new [] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character # run a few commands assume-console [ left-click 1, 0 @@ -13,7 +13,7 @@ scenario deleting-sandboxes [ type [add 2, 2] press F4 ] - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data screen-should-contain [ . run (F4) . . . @@ -34,7 +34,7 @@ scenario deleting-sandboxes [ left-click 7, 49 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . @@ -52,7 +52,7 @@ scenario deleting-sandboxes [ left-click 3, 49 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . diff --git a/sandbox/009-sandbox-trace.mu b/sandbox/009-sandbox-trace.mu index 88b4e877..c05c00d8 100644 --- a/sandbox/009-sandbox-trace.mu +++ b/sandbox/009-sandbox-trace.mu @@ -8,8 +8,8 @@ scenario sandbox-click-on-code-toggles-app-trace [ assume-console [ press F4 ] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character - event-loop screen:address, console:address, 2:address:programming-environment-data + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data screen-should-contain [ . run (F4) . . . @@ -24,8 +24,8 @@ scenario sandbox-click-on-code-toggles-app-trace [ left-click 4, 21 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data - print-character screen:address, 9251/␣/cursor + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data + print-character screen:address:screen, 9251/␣/cursor ] # trace now printed and cursor shouldn't have budged screen-should-contain [ @@ -53,8 +53,8 @@ scenario sandbox-click-on-code-toggles-app-trace [ left-click 4, 25 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data - print-character screen:address, 9251/␣/cursor + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data + print-character screen:address:screen, 9251/␣/cursor ] # trace hidden again screen-should-contain [ @@ -77,8 +77,8 @@ add 2, 2] assume-console [ press F4 ] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character - event-loop screen:address, console:address, 2:address:programming-environment-data + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data screen-should-contain [ . run (F4) . . . @@ -95,7 +95,7 @@ add 2, 2] left-click 4, 21 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] # trace now printed above result screen-should-contain [ diff --git a/sandbox/010-warnings.mu b/sandbox/010-warnings.mu index d32f6e8e..31e85418 100644 --- a/sandbox/010-warnings.mu +++ b/sandbox/010-warnings.mu @@ -8,7 +8,7 @@ container programming-environment-data [ recipe! update-recipes [ local-scope env:address:programming-environment-data <- next-ingredient - screen:address <- next-ingredient + screen:address:screen <- next-ingredient in:address:array:character <- restore [recipes.mu] recipe-warnings:address:address:array:character <- get-address *env, recipe-warnings:offset *recipe-warnings <- reload in @@ -80,12 +80,12 @@ scenario run-instruction-and-print-warnings [ trace-until 100/app # trace too long assume-screen 50/width, 15/height 1:address:array:character <- new [get 1:address:point, 1:offset] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character assume-console [ press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . @@ -118,14 +118,14 @@ scenario run-instruction-and-print-warnings-only-once [ assume-screen 50/width, 10/height # editor contains an illegal instruction 1:address:array:character <- new [get 1234:number, foo:offset] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character # run the code in the editors multiple times assume-console [ press F4 press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] # check that screen prints error message just once screen-should-contain [ @@ -149,13 +149,13 @@ scenario sandbox-can-handle-infinite-loop [ 1:address:array:character <- new [{ loop }] - 2:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character + 2:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character # run the sandbox assume-console [ press F4 ] run [ - event-loop screen:address, console:address, 2:address:programming-environment-data + event-loop screen:address:screen, console:address:console, 2:address:programming-environment-data ] screen-should-contain [ . run (F4) . diff --git a/sandbox/011-editor-undo.mu b/sandbox/011-editor-undo.mu index fe44110f..17d97213 100644 --- a/sandbox/011-editor-undo.mu +++ b/sandbox/011-editor-undo.mu @@ -98,18 +98,18 @@ scenario editor-can-undo-typing [ # create an editor and type a character assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [0] ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # character should be gone screen-should-contain [ @@ -123,7 +123,7 @@ scenario editor-can-undo-typing [ type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -220,18 +220,18 @@ scenario editor-can-undo-typing-multiple [ # create an editor and type multiple characters assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [012] ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # all characters must be gone screen-should-contain [ @@ -246,13 +246,13 @@ scenario editor-can-undo-typing-multiple-2 [ # create an editor with some text assume-screen 10/width, 5/height 1:address:array:character <- new [a] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # type some characters assume-console [ type [012] ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .012a . @@ -264,7 +264,7 @@ scenario editor-can-undo-typing-multiple-2 [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # back to original text screen-should-contain [ @@ -278,7 +278,7 @@ scenario editor-can-undo-typing-multiple-2 [ type [3] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -292,14 +292,14 @@ scenario editor-can-undo-typing-enter [ # create an editor with some text assume-screen 10/width, 5/height 1:address:array:character <- new [ abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # new line assume-console [ left-click 1, 8 press enter ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . . abc . @@ -319,7 +319,7 @@ scenario editor-can-undo-typing-enter [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset @@ -339,7 +339,7 @@ scenario editor-can-undo-typing-enter [ type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -355,13 +355,13 @@ scenario editor-redo-typing [ # create an editor, type something, undo assume-screen 10/width, 5/height 1:address:array:character <- new [a] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [012] press ctrl-z ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .a . @@ -373,7 +373,7 @@ scenario editor-redo-typing [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # all characters must be back screen-should-contain [ @@ -387,7 +387,7 @@ scenario editor-redo-typing [ type [3] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -416,13 +416,13 @@ scenario editor-redo-typing-empty [ # create an editor, type something, undo assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [012] press ctrl-z ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . . . @@ -434,7 +434,7 @@ scenario editor-redo-typing-empty [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # all characters must be back screen-should-contain [ @@ -448,7 +448,7 @@ scenario editor-redo-typing-empty [ type [3] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -464,18 +464,18 @@ scenario editor-work-clears-redo-stack [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [1] press ctrl-z ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # do some more work assume-console [ type [0] ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .0abc . @@ -488,7 +488,7 @@ ghi] press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # nothing should happen screen-should-contain [ @@ -504,7 +504,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ # create an editor assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and tabs, hit enter, some more text and tabs assume-console [ @@ -516,7 +516,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press tab type [efg] ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . . ab cd . @@ -535,7 +535,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # typing in second line deleted, but not indent 3:number <- get *2:address:editor-data, cursor-row:offset @@ -556,7 +556,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # indent and newline deleted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -576,7 +576,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # empty screen 3:number <- get *2:address:editor-data, cursor-row:offset @@ -596,7 +596,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # first line inserted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -616,7 +616,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # newline and indent inserted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -637,7 +637,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # indent and newline deleted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -663,19 +663,19 @@ scenario editor-can-undo-touch [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ left-click 3, 1 ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -689,7 +689,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -754,13 +754,13 @@ scenario editor-can-undo-scroll [ 1:address:array:character <- new [a b cdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 5/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right # position cursor at end of screen and try to move right assume-console [ left-click 3, 3 press right-arrow ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset # screen scrolls @@ -779,7 +779,7 @@ cdefgh] press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -800,7 +800,7 @@ cdefgh] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -816,20 +816,20 @@ scenario editor-can-undo-left-arrow [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ left-click 3, 1 press left-arrow ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -843,7 +843,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -860,14 +860,14 @@ scenario editor-can-undo-up-arrow [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ left-click 3, 1 press up-arrow ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset memory-should-contain [ @@ -879,7 +879,7 @@ ghi] press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -893,7 +893,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -910,20 +910,20 @@ scenario editor-can-undo-down-arrow [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ left-click 2, 1 press down-arrow ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -937,7 +937,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -957,19 +957,19 @@ c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page assume-console [ press ctrl-f ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -992,19 +992,19 @@ c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page assume-console [ press page-down ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1027,20 +1027,20 @@ c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page down and up assume-console [ press page-down press ctrl-b ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1063,20 +1063,20 @@ c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page down and up assume-console [ press page-down press page-up ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1096,20 +1096,20 @@ scenario editor-can-undo-ctrl-a [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ left-click 2, 1 press ctrl-a ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1123,7 +1123,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1140,20 +1140,20 @@ scenario editor-can-undo-home [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ left-click 2, 1 press home ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1167,7 +1167,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1184,20 +1184,20 @@ scenario editor-can-undo-ctrl-e [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ left-click 2, 1 press ctrl-e ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1211,7 +1211,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1228,20 +1228,20 @@ scenario editor-can-undo-end [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ left-click 2, 1 press end ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1255,7 +1255,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1270,14 +1270,14 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ # create an editor, type some text, move the cursor, type some more text assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [abc] left-click 1, 1 type [d] ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset screen-should-contain [ @@ -1295,7 +1295,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1315,7 +1315,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1335,7 +1335,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1355,7 +1355,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1375,7 +1375,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1395,7 +1395,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1418,7 +1418,7 @@ scenario editor-can-undo-multiple-arrows-in-the-same-direction [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ @@ -1427,7 +1427,7 @@ ghi] press right-arrow press up-arrow ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset memory-should-contain [ @@ -1439,7 +1439,7 @@ ghi] press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1453,7 +1453,7 @@ ghi] press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1472,19 +1472,19 @@ scenario editor-redo-touch [ 1:address:array:character <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ left-click 3, 1 press ctrl-z ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data # redo assume-console [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -1498,7 +1498,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1527,7 +1527,7 @@ scenario editor-can-undo-and-redo-backspace [ # create an editor assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit backspace assume-console [ @@ -1535,7 +1535,7 @@ scenario editor-can-undo-and-redo-backspace [ press backspace press backspace ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .a . @@ -1553,7 +1553,7 @@ scenario editor-can-undo-and-redo-backspace [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset @@ -1572,7 +1572,7 @@ scenario editor-can-undo-and-redo-backspace [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset @@ -1668,7 +1668,7 @@ scenario editor-can-undo-and-redo-delete [ # create an editor assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ @@ -1679,7 +1679,7 @@ scenario editor-can-undo-and-redo-delete [ press delete press delete ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .af . @@ -1697,7 +1697,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset @@ -1716,7 +1716,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset @@ -1735,7 +1735,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset @@ -1754,7 +1754,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # first line inserted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -1774,7 +1774,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # first line inserted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -1794,7 +1794,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # first line inserted 3:number <- get *2:address:editor-data, cursor-row:offset @@ -1856,14 +1856,14 @@ scenario editor-can-undo-and-redo-ctrl-k [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ left-click 1, 1 press ctrl-k ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .a . @@ -1882,7 +1882,7 @@ def] press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1902,7 +1902,7 @@ def] press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # first line inserted screen-should-contain [ @@ -1923,7 +1923,7 @@ def] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -1957,14 +1957,14 @@ scenario editor-can-undo-and-redo-ctrl-u [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ left-click 1, 2 press ctrl-u ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .c . @@ -1983,7 +1983,7 @@ def] press ctrl-z ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2003,7 +2003,7 @@ def] press ctrl-y ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] # first line inserted screen-should-contain [ @@ -2024,7 +2024,7 @@ def] type [1] ] run [ - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data ] screen-should-contain [ . . @@ -2055,7 +2055,7 @@ scenario editor-can-undo-and-redo-ctrl-u-2 [ # create an editor assume-screen 10/width, 5/height 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 10/right + 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ @@ -2063,7 +2063,7 @@ scenario editor-can-undo-and-redo-ctrl-u-2 [ press ctrl-u press ctrl-z ] - editor-event-loop screen:address, console:address, 2:address:editor-data + editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data screen-should-contain [ . . .abc . |