diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-06 10:51:11 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-06 10:52:37 -0700 |
commit | 55479bc29dfc7148e38d8c24b072e3588739f18e (patch) | |
tree | 98fc37560c59bde6ee1b71163bae017df2f3abe5 /sandbox | |
parent | 5af07e1c2c65e74ecacaa3077e17a492a8532ab0 (diff) | |
download | mu-55479bc29dfc7148e38d8c24b072e3588739f18e.tar.gz |
3445
Ugly that we didn't need 'screen' to provide a type in scenarios (because assume-screen expands to a definition of 'screen') but we did need a type for 'console'. Just never require types for special names in scenarios.
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/001-editor.mu | 20 | ||||
-rw-r--r-- | sandbox/002-typing.mu | 102 | ||||
-rw-r--r-- | sandbox/003-shortcuts.mu | 200 | ||||
-rw-r--r-- | sandbox/005-sandbox.mu | 66 | ||||
-rw-r--r-- | sandbox/006-sandbox-copy.mu | 24 | ||||
-rw-r--r-- | sandbox/007-sandbox-delete.mu | 32 | ||||
-rw-r--r-- | sandbox/008-sandbox-edit.mu | 28 | ||||
-rw-r--r-- | sandbox/009-sandbox-test.mu | 10 | ||||
-rw-r--r-- | sandbox/010-sandbox-trace.mu | 24 | ||||
-rw-r--r-- | sandbox/011-errors.mu | 70 | ||||
-rw-r--r-- | sandbox/012-editor-undo.mu | 214 |
11 files changed, 395 insertions, 395 deletions
diff --git a/sandbox/001-editor.mu b/sandbox/001-editor.mu index bbe16390..7f799445 100644 --- a/sandbox/001-editor.mu +++ b/sandbox/001-editor.mu @@ -17,7 +17,7 @@ scenario editor-initially-prints-text-to-screen [ local-scope assume-screen 10/width, 5/height run [ - new-editor [abc], screen:&:screen, 0/left, 10/right + new-editor [abc], screen, 0/left, 10/right ] screen-should-contain [ # top line of screen reserved for menu @@ -98,7 +98,7 @@ scenario editor-initializes-without-data [ local-scope assume-screen 5/width, 3/height run [ - e:&:editor <- new-editor 0/data, screen:&:screen, 2/left, 5/right + e:&:editor <- new-editor 0/data, screen, 2/left, 5/right 2:editor/raw <- copy *e ] memory-should-contain [ @@ -261,7 +261,7 @@ scenario editor-initially-prints-multiple-lines [ run [ s:text <- new [abc def] - new-editor s, screen:&:screen, 0/left, 5/right + new-editor s, screen, 0/left, 5/right ] screen-should-contain [ . . @@ -276,7 +276,7 @@ scenario editor-initially-handles-offsets [ assume-screen 5/width, 5/height run [ s:text <- new [abc] - new-editor s, screen:&:screen, 1/left, 5/right + new-editor s, screen, 1/left, 5/right ] screen-should-contain [ . . @@ -291,7 +291,7 @@ scenario editor-initially-prints-multiple-lines-at-offset [ run [ s:text <- new [abc def] - new-editor s, screen:&:screen, 1/left, 5/right + new-editor s, screen, 1/left, 5/right ] screen-should-contain [ . . @@ -306,7 +306,7 @@ scenario editor-initially-wraps-long-lines [ assume-screen 5/width, 5/height run [ s:text <- new [abc def] - new-editor s, screen:&:screen, 0/left, 5/right + new-editor s, screen, 0/left, 5/right ] screen-should-contain [ . . @@ -327,7 +327,7 @@ scenario editor-initially-wraps-barely-long-lines [ assume-screen 5/width, 5/height run [ s:text <- new [abcde] - new-editor s, screen:&:screen, 0/left, 5/right + new-editor s, screen, 0/left, 5/right ] # still wrap, even though the line would fit. We need room to click on the # end of the line @@ -349,7 +349,7 @@ scenario editor-initializes-empty-text [ local-scope assume-screen 5/width, 5/height run [ - e:&:editor <- new-editor [], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [], screen, 0/left, 5/right 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -373,7 +373,7 @@ scenario render-colors-comments [ s:text <- new [abc # de f] - new-editor s, screen:&:screen, 0/left, 5/right + new-editor s, screen, 0/left, 5/right ] screen-should-contain [ . . @@ -455,7 +455,7 @@ scenario render-colors-assignment [ s:text <- new [abc d <- e f] - new-editor s, screen:&:screen, 0/left, 8/right + new-editor s, screen, 0/left, 8/right ] screen-should-contain [ . . diff --git a/sandbox/002-typing.mu b/sandbox/002-typing.mu index 07466d38..2f94f362 100644 --- a/sandbox/002-typing.mu +++ b/sandbox/002-typing.mu @@ -20,7 +20,7 @@ def editor-event-loop screen:&:screen, console:&:console, editor:&:editor -> scr cursor-row:num <- get *editor, cursor-row:offset cursor-column:num <- get *editor, cursor-column:offset screen <- move-cursor screen, cursor-row, cursor-column - e:event, console:&:console, found?:bool, quit?:bool <- read-event console + e:event, console, found?:bool, quit?:bool <- read-event console loop-unless found? break-if quit? # only in tests trace 10, [app], [next-event] @@ -283,11 +283,11 @@ def editor-render screen:&:screen, editor:&:editor -> screen:&:screen, editor:&: scenario editor-handles-empty-event-queue [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e assume-console [] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -300,14 +300,14 @@ scenario editor-handles-empty-event-queue [ scenario editor-handles-mouse-clicks [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ left-click 1, 1 # on the 'b' ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -327,13 +327,13 @@ scenario editor-handles-mouse-clicks [ scenario editor-handles-mouse-clicks-outside-text [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], 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:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -349,13 +349,13 @@ scenario editor-handles-mouse-clicks-outside-text-2 [ assume-screen 10/width, 5/height s:text <- new [abc def] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -371,13 +371,13 @@ scenario editor-handles-mouse-clicks-outside-text-3 [ assume-screen 10/width, 5/height s:text <- new [abc def] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right $clear-trace assume-console [ left-click 3, 7 # below text ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -392,7 +392,7 @@ scenario editor-handles-mouse-clicks-outside-column [ local-scope assume-screen 10/width, 5/height # editor occupies only left half of screen - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abc], screen, 0/left, 5/right editor-render screen, e $clear-trace assume-console [ @@ -400,7 +400,7 @@ scenario editor-handles-mouse-clicks-outside-column [ left-click 3, 8 ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -420,7 +420,7 @@ scenario editor-handles-mouse-clicks-outside-column [ scenario editor-handles-mouse-clicks-in-menu-area [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abc], screen, 0/left, 5/right editor-render screen, e $clear-trace assume-console [ @@ -428,7 +428,7 @@ scenario editor-handles-mouse-clicks-in-menu-area [ left-click 0, 3 ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -442,14 +442,14 @@ scenario editor-handles-mouse-clicks-in-menu-area [ scenario editor-inserts-characters-into-empty-editor [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [], screen, 0/left, 5/right editor-render screen, e $clear-trace assume-console [ type [abc] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -463,7 +463,7 @@ scenario editor-inserts-characters-into-empty-editor [ scenario editor-inserts-characters-at-cursor [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace # type two letters at different places @@ -473,7 +473,7 @@ scenario editor-inserts-characters-at-cursor [ type [d] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -487,7 +487,7 @@ scenario editor-inserts-characters-at-cursor [ scenario editor-inserts-characters-at-cursor-2 [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -495,7 +495,7 @@ scenario editor-inserts-characters-at-cursor-2 [ type [d] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -511,7 +511,7 @@ scenario editor-inserts-characters-at-cursor-5 [ assume-screen 10/width, 5/height s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -519,7 +519,7 @@ d] type [e] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -534,7 +534,7 @@ d] scenario editor-inserts-characters-at-cursor-3 [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -542,7 +542,7 @@ scenario editor-inserts-characters-at-cursor-3 [ type [d] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -558,7 +558,7 @@ scenario editor-inserts-characters-at-cursor-4 [ assume-screen 10/width, 5/height s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -566,7 +566,7 @@ d] type [e] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -583,7 +583,7 @@ scenario editor-inserts-characters-at-cursor-6 [ assume-screen 10/width, 5/height s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -591,7 +591,7 @@ d] type [ef] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -606,13 +606,13 @@ d] scenario editor-moves-cursor-after-inserting-characters [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [ab], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [ab], screen, 0/left, 5/right editor-render screen, e assume-console [ type [01] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -627,14 +627,14 @@ scenario editor-moves-cursor-after-inserting-characters [ scenario editor-wraps-line-on-insert [ local-scope assume-screen 5/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abc], screen, 0/left, 5/right editor-render screen, e # type a letter assume-console [ type [e] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # no wrap yet screen-should-contain [ @@ -649,7 +649,7 @@ scenario editor-wraps-line-on-insert [ type [f] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # now wrap screen-should-contain [ @@ -667,7 +667,7 @@ scenario editor-wraps-line-on-insert-2 [ assume-screen 10/width, 5/height s:text <- new [abcdefg defg] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor s, screen, 0/left, 5/right editor-render screen, e # type more text at the start assume-console [ @@ -675,7 +675,7 @@ defg] type [abc] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -748,13 +748,13 @@ after <insert-character-special-case> [ scenario editor-wraps-cursor-after-inserting-characters-in-middle-of-line [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abcde], screen, 0/left, 5/right assume-console [ left-click 1, 3 # right before the wrap icon type [f] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -789,7 +789,7 @@ xyz] type [de] # trigger wrap ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -803,13 +803,13 @@ xyz] scenario editor-wraps-cursor-to-left-margin [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abcde], screen:&:screen, 2/left, 7/right + e:&:editor <- new-editor [abcde], 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:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -839,13 +839,13 @@ after <editor-initialization> [ scenario editor-moves-cursor-down-after-inserting-newline [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right assume-console [ type [0 1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -945,13 +945,13 @@ def line-indent curr:&:duplex-list:char, start:&:duplex-list:char -> result:num scenario editor-moves-cursor-down-after-inserting-newline-2 [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 1/left, 10/right + e:&:editor <- new-editor [abc], screen, 1/left, 10/right assume-console [ type [0 1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -965,7 +965,7 @@ scenario editor-moves-cursor-down-after-inserting-newline-2 [ scenario editor-clears-previous-line-completely-after-inserting-newline [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abcde], screen, 0/left, 5/right assume-console [ press enter ] @@ -977,7 +977,7 @@ scenario editor-clears-previous-line-completely-after-inserting-newline [ . . ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # line should be fully cleared screen-should-contain [ @@ -995,7 +995,7 @@ scenario editor-inserts-indent-after-newline [ s:text <- new [ab cd ef] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' assume-console [ left-click 2, 8 @@ -1003,7 +1003,7 @@ ef] ] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1020,7 +1020,7 @@ scenario editor-skips-indent-around-paste [ s:text <- new [ab cd ef] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' surrounded by paste markers assume-console [ left-click 2, 8 @@ -1029,7 +1029,7 @@ ef] press 65506 # end paste ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] diff --git a/sandbox/003-shortcuts.mu b/sandbox/003-shortcuts.mu index 3c0f36d5..7c5d0df2 100644 --- a/sandbox/003-shortcuts.mu +++ b/sandbox/003-shortcuts.mu @@ -10,12 +10,12 @@ scenario editor-inserts-two-spaces-on-tab [ # just one character in final line s:text <- new [ab cd] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor s, screen, 0/left, 5/right assume-console [ press tab ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -42,7 +42,7 @@ after <handle-special-character> [ scenario editor-handles-backspace-key [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -50,7 +50,7 @@ scenario editor-handles-backspace-key [ press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -216,13 +216,13 @@ scenario editor-clears-last-line-on-backspace [ # just one character in final line s:text <- new [ab cd] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -244,7 +244,7 @@ scenario editor-joins-and-wraps-lines-on-backspace [ # initialize editor with two long-ish but non-wrapping lines s:text <- new [abc def ghi jkl] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # position the cursor at the start of the second and hit backspace @@ -253,7 +253,7 @@ ghi jkl] press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # resulting single line should wrap correctly screen-should-contain [ @@ -269,7 +269,7 @@ scenario editor-wraps-long-lines-on-backspace [ local-scope assume-screen 10/width, 5/height # initialize editor in part of the screen with a long line - e:&:editor <- new-editor [abc def ghij], screen:&:screen, 0/left, 8/right + e:&:editor <- new-editor [abc def ghij], screen, 0/left, 8/right editor-render screen, e # confirm that it wraps screen-should-contain [ @@ -285,7 +285,7 @@ scenario editor-wraps-long-lines-on-backspace [ press backspace ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # resulting single line should wrap correctly and not overflow its bounds screen-should-contain [ @@ -302,14 +302,14 @@ scenario editor-wraps-long-lines-on-backspace [ scenario editor-handles-delete-key [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ press delete ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -323,7 +323,7 @@ scenario editor-handles-delete-key [ press delete ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -391,7 +391,7 @@ def delete-at-cursor editor:&:editor, screen:&:screen -> editor:&:editor, screen scenario editor-moves-cursor-right-with-key [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -399,7 +399,7 @@ scenario editor-moves-cursor-right-with-key [ type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -488,7 +488,7 @@ scenario editor-moves-cursor-to-next-line-with-right-arrow [ assume-screen 10/width, 5/height s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # type right-arrow a few times to get to start of second line @@ -499,7 +499,7 @@ d] press right-arrow # next line ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] check-trace-count-for-label 0, [print-character] # type something and ensure it goes where it should @@ -507,7 +507,7 @@ d] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -524,7 +524,7 @@ scenario editor-moves-cursor-to-next-line-with-right-arrow-2 [ assume-screen 10/width, 5/height s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 1/left, 10/right + e:&:editor <- new-editor s, screen, 1/left, 10/right editor-render screen, e assume-console [ press right-arrow @@ -534,7 +534,7 @@ d] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -548,7 +548,7 @@ d] scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abcdef], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abcdef], screen, 0/left, 5/right editor-render screen, e $clear-trace assume-console [ @@ -556,7 +556,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -578,7 +578,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ local-scope assume-screen 10/width, 5/height # line just barely wrapping - e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abcde], screen, 0/left, 5/right editor-render screen, e $clear-trace # position cursor at last character before wrap and hit right-arrow @@ -587,7 +587,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -600,7 +600,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -614,7 +614,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 [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abcdef], screen:&:screen, 1/left, 6/right + e:&:editor <- new-editor [abcdef], screen, 1/left, 6/right editor-render screen, e $clear-trace assume-console [ @@ -622,7 +622,7 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [ press right-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -645,7 +645,7 @@ scenario editor-moves-cursor-to-next-line-with-right-arrow-at-end-of-line [ assume-screen 10/width, 5/height s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # move to end of line, press right-arrow, type a character @@ -655,7 +655,7 @@ d] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # new character should be in next line screen-should-contain [ @@ -675,7 +675,7 @@ d] scenario editor-moves-cursor-left-with-key [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -684,7 +684,7 @@ scenario editor-moves-cursor-left-with-key [ type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -720,7 +720,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line [ # initialize editor with two lines s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # position cursor at start of second line (so there's no previous newline) @@ -729,7 +729,7 @@ d] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -747,7 +747,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-2 s:text <- new [abc def g] - e:&:editor <- new-editor s:text, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s:text, screen, 0/left, 10/right editor-render screen, e $clear-trace # position cursor further down (so there's a newline before the character at @@ -758,7 +758,7 @@ g] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -776,7 +776,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-3 s:text <- new [abc def g] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # position cursor at start of text, press left-arrow, then type a character @@ -786,7 +786,7 @@ g] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # left-arrow should have had no effect screen-should-contain [ @@ -806,7 +806,7 @@ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-4 s:text <- new [abc d] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e:&:editor $clear-trace # position cursor right after empty line @@ -816,7 +816,7 @@ d] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -832,7 +832,7 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [ local-scope assume-screen 10/width, 5/height # initialize editor with a wrapping line - e:&:editor <- new-editor [abcdef], screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor [abcdef], screen, 0/left, 5/right editor-render screen, e $clear-trace screen-should-contain [ @@ -848,7 +848,7 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [ press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -865,7 +865,7 @@ scenario editor-moves-across-screen-lines-to-wrapping-line-with-left-arrow [ # initialize editor with a wrapping line followed by a second line s:text <- new [abcdef g] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor s, screen, 0/left, 5/right editor-render screen, e $clear-trace screen-should-contain [ @@ -881,7 +881,7 @@ g] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -898,7 +898,7 @@ scenario editor-moves-across-screen-lines-to-non-wrapping-line-with-left-arrow [ # initialize editor with a line on the verge of wrapping, followed by a second line s:text <- new [abcd e] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right + e:&:editor <- new-editor s, screen, 0/left, 5/right editor-render screen, e $clear-trace screen-should-contain [ @@ -914,7 +914,7 @@ e] press left-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -934,7 +934,7 @@ scenario editor-moves-to-previous-line-with-up-arrow [ assume-screen 10/width, 5/height s:text <- new [abc def] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -942,7 +942,7 @@ def] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -955,7 +955,7 @@ def] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1050,7 +1050,7 @@ scenario editor-adjusts-column-at-previous-line [ assume-screen 10/width, 5/height s:text <- new [ab def] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -1058,7 +1058,7 @@ def] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1071,7 +1071,7 @@ def] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1087,7 +1087,7 @@ scenario editor-adjusts-column-at-empty-line [ assume-screen 10/width, 5/height s:text <- new [ def] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -1095,7 +1095,7 @@ def] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1108,7 +1108,7 @@ def] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1126,7 +1126,7 @@ scenario editor-moves-to-previous-line-from-left-margin [ s:text <- new [abc def ghi] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # click on the third line and hit up-arrow, so you end up just after a newline @@ -1135,7 +1135,7 @@ ghi] press up-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1148,7 +1148,7 @@ ghi] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1166,7 +1166,7 @@ scenario editor-moves-to-next-line-with-down-arrow [ assume-screen 10/width, 5/height s:text <- new [abc def] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # cursor starts out at (1, 0) @@ -1174,7 +1174,7 @@ def] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1188,7 +1188,7 @@ def] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1258,7 +1258,7 @@ scenario editor-adjusts-column-at-next-line [ assume-screen 10/width, 5/height s:text <- new [abc de] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace assume-console [ @@ -1266,7 +1266,7 @@ de] press down-arrow ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1279,7 +1279,7 @@ de] type [0] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1297,7 +1297,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on second line, press ctrl-a @@ -1306,7 +1306,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a [ press ctrl-a ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -1373,7 +1373,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on first line (no newline before), press ctrl-a @@ -1382,7 +1382,7 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [ press ctrl-a ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -1399,7 +1399,7 @@ scenario editor-moves-to-start-of-line-with-home [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right $clear-trace # start on second line, press 'home' assume-console [ @@ -1407,7 +1407,7 @@ scenario editor-moves-to-start-of-line-with-home [ press home ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1424,7 +1424,7 @@ scenario editor-moves-to-start-of-line-with-home-2 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on first line (no newline before), press 'home' @@ -1433,7 +1433,7 @@ scenario editor-moves-to-start-of-line-with-home-2 [ press home ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1452,7 +1452,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on first line, press ctrl-e @@ -1461,7 +1461,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [ press ctrl-e ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -1476,7 +1476,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [ type [z] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -1545,7 +1545,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on second line (no newline after), press ctrl-e @@ -1554,7 +1554,7 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [ press ctrl-e ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 4:num/raw <- get *e, cursor-row:offset 5:num/raw <- get *e, cursor-column:offset ] @@ -1571,7 +1571,7 @@ scenario editor-moves-to-end-of-line-with-end [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on first line, press 'end' @@ -1580,7 +1580,7 @@ scenario editor-moves-to-end-of-line-with-end [ press end ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1597,7 +1597,7 @@ scenario editor-moves-to-end-of-line-with-end-2 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right editor-render screen, e $clear-trace # start on second line (no newline after), press 'end' @@ -1606,7 +1606,7 @@ scenario editor-moves-to-end-of-line-with-end-2 [ press end ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1625,14 +1625,14 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes to start of line screen-should-contain [ @@ -1689,14 +1689,14 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-2 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes to start of line screen-should-contain [ @@ -1713,14 +1713,14 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-3 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes to start of line screen-should-contain [ @@ -1737,14 +1737,14 @@ scenario editor-deletes-to-start-of-final-line-with-ctrl-u [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes to start of line screen-should-contain [ @@ -1763,14 +1763,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes to end of line screen-should-contain [ @@ -1819,14 +1819,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-2 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, 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:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes to end of line screen-should-contain [ @@ -1843,14 +1843,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-3 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right # start at end of line assume-console [ left-click 1, 2 press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes just last character screen-should-contain [ @@ -1867,14 +1867,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-4 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right # start past end of line assume-console [ left-click 1, 3 press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes nothing screen-should-contain [ @@ -1891,14 +1891,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-5 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right # start at end of text assume-console [ left-click 2, 2 press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes just the final character screen-should-contain [ @@ -1915,14 +1915,14 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-6 [ assume-screen 10/width, 5/height s:text <- new [123 456] - e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor s, screen, 0/left, 10/right # start past end of text assume-console [ left-click 2, 3 press ctrl-k ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor deletes nothing screen-should-contain [ diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index c83e9f9c..cd37e7a8 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -33,13 +33,13 @@ scenario run-and-show-results [ trace-until 100/app # trace too long assume-screen 50/width, 15/height # sandbox editor contains an instruction without storing outputs - env:&:environment <- new-programming-environment screen:&:screen, [divide-with-remainder 11, 3] + env:&:environment <- new-programming-environment screen, [divide-with-remainder 11, 3] # run the code in the editors assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # check that screen prints the results screen-should-contain [ @@ -82,7 +82,7 @@ scenario run-and-show-results [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # check that screen prints both sandboxes screen-should-contain [ @@ -512,12 +512,12 @@ z:num <- add 2, 2 reply z ]] # sandbox editor contains an instruction without storing outputs - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] # run the code in the editors assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes screen-should-contain [ . run (F4) . . . @@ -539,7 +539,7 @@ return z press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] # check that screen updates the result on the right screen-should-contain [ @@ -559,13 +559,13 @@ scenario run-instruction-manages-screen-per-sandbox [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # editor contains an instruction - env:&:environment <- new-programming-environment screen:&:screen, [print-integer screen, 4] + env:&:environment <- new-programming-environment screen, [print-integer screen, 4] # run the code in the editor assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # check that it prints a little toy screen screen-should-contain [ @@ -607,13 +607,13 @@ def editor-contents editor:&:editor -> result:text [ scenario editor-provides-edited-contents [ local-scope assume-screen 10/width, 5/height - e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [abc], screen, 0/left, 10/right assume-console [ left-click 1, 2 type [def] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e s:text <- editor-contents e 1:@:char/raw <- copy *s ] @@ -629,13 +629,13 @@ scenario scrolling-down-past-bottom-of-sandbox-editor [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # initialize - env:&:environment <- new-programming-environment screen:&:screen, [add 2, 2] + env:&:environment <- new-programming-environment screen, [add 2, 2] render-all screen, env, render assume-console [ # create a sandbox press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -651,9 +651,9 @@ scenario scrolling-down-past-bottom-of-sandbox-editor [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] # sandbox editor hidden; first sandbox displayed # cursor moves to first sandbox @@ -671,9 +671,9 @@ scenario scrolling-down-past-bottom-of-sandbox-editor [ press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] # sandbox editor displays again screen-should-contain [ @@ -765,7 +765,7 @@ scenario scrolling-through-multiple-sandboxes [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes assume-console [ @@ -775,9 +775,9 @@ scenario scrolling-through-multiple-sandboxes [ type [add 1, 1] press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor screen-should-contain [ . run (F4) . .␣ . @@ -797,9 +797,9 @@ scenario scrolling-through-multiple-sandboxes [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] # sandbox editor hidden; first sandbox displayed # cursor moves to first sandbox @@ -821,7 +821,7 @@ scenario scrolling-through-multiple-sandboxes [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # just second sandbox displayed screen-should-contain [ @@ -838,7 +838,7 @@ scenario scrolling-through-multiple-sandboxes [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # no change screen-should-contain [ @@ -855,7 +855,7 @@ scenario scrolling-through-multiple-sandboxes [ press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # back to displaying both sandboxes without editor screen-should-contain [ @@ -876,9 +876,9 @@ scenario scrolling-through-multiple-sandboxes [ press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] # back to displaying both sandboxes as well as editor screen-should-contain [ @@ -900,9 +900,9 @@ scenario scrolling-through-multiple-sandboxes [ press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] # no change screen-should-contain [ @@ -926,7 +926,7 @@ scenario scrolling-manages-sandbox-index-correctly [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create a sandbox assume-console [ @@ -934,7 +934,7 @@ scenario scrolling-manages-sandbox-index-correctly [ type [add 1, 1] press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -950,7 +950,7 @@ scenario scrolling-manages-sandbox-index-correctly [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # sandbox editor hidden; first sandbox displayed # cursor moves to first sandbox @@ -968,7 +968,7 @@ scenario scrolling-manages-sandbox-index-correctly [ press page-up ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # back to displaying both sandboxes as well as editor screen-should-contain [ @@ -986,7 +986,7 @@ scenario scrolling-manages-sandbox-index-correctly [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # sandbox editor hidden; first sandbox displayed # cursor moves to first sandbox diff --git a/sandbox/006-sandbox-copy.mu b/sandbox/006-sandbox-copy.mu index ea7d86ab..784ae1eb 100644 --- a/sandbox/006-sandbox-copy.mu +++ b/sandbox/006-sandbox-copy.mu @@ -5,11 +5,11 @@ scenario copy-a-sandbox-to-editor [ local-scope trace-until 50/app # trace too long assume-screen 50/width, 10/height - env:&:environment <- new-programming-environment screen:&:screen, [add 1, 1] + env:&:environment <- new-programming-environment screen, [add 1, 1] assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -27,7 +27,7 @@ scenario copy-a-sandbox-to-editor [ left-click 3, 19 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # it copies into editor screen-should-contain [ @@ -47,7 +47,7 @@ scenario copy-a-sandbox-to-editor [ type [0] ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . @@ -67,11 +67,11 @@ scenario copy-a-sandbox-to-editor-2 [ local-scope trace-until 50/app # trace too long assume-screen 50/width, 10/height - env:&:environment <- new-programming-environment screen:&:screen, [add 1, 1] + env:&:environment <- new-programming-environment screen, [add 1, 1] assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -89,7 +89,7 @@ scenario copy-a-sandbox-to-editor-2 [ left-click 3, 33 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # it copies into editor screen-should-contain [ @@ -109,7 +109,7 @@ scenario copy-a-sandbox-to-editor-2 [ type [0] ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . @@ -218,11 +218,11 @@ scenario copy-fails-if-sandbox-editor-not-empty [ local-scope trace-until 50/app # trace too long assume-screen 50/width, 10/height - env:&:environment <- new-programming-environment screen:&:screen, [add 1, 1] + env:&:environment <- new-programming-environment screen, [add 1, 1] assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -240,7 +240,7 @@ scenario copy-fails-if-sandbox-editor-not-empty [ left-click 3, 20 # click 'copy' button ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # copy doesn't happen screen-should-contain [ @@ -258,7 +258,7 @@ scenario copy-fails-if-sandbox-editor-not-empty [ type [1] ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . diff --git a/sandbox/007-sandbox-delete.mu b/sandbox/007-sandbox-delete.mu index 59fa2c6b..ff04344f 100644 --- a/sandbox/007-sandbox-delete.mu +++ b/sandbox/007-sandbox-delete.mu @@ -4,7 +4,7 @@ scenario deleting-sandboxes [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 15/height - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] # run a few commands assume-console [ type [divide-with-remainder 11, 3] @@ -12,7 +12,7 @@ scenario deleting-sandboxes [ type [add 2, 2] press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -33,7 +33,7 @@ scenario deleting-sandboxes [ left-click 7, 34 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . @@ -50,7 +50,7 @@ scenario deleting-sandboxes [ left-click 3, 49 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . @@ -148,7 +148,7 @@ scenario deleting-sandbox-after-scroll [ trace-until 100/app # trace too long assume-screen 50/width, 10/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes and scroll to second assume-console [ @@ -159,7 +159,7 @@ scenario deleting-sandbox-after-scroll [ press F4 press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -177,7 +177,7 @@ scenario deleting-sandbox-after-scroll [ left-click 6, 34 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # second sandbox shows in editor; scroll resets to display first sandbox screen-should-contain [ @@ -196,7 +196,7 @@ scenario deleting-top-sandbox-after-scroll [ trace-until 100/app # trace too long assume-screen 50/width, 10/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes and scroll to second assume-console [ @@ -207,7 +207,7 @@ scenario deleting-top-sandbox-after-scroll [ press F4 press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -225,7 +225,7 @@ scenario deleting-top-sandbox-after-scroll [ left-click 2, 34 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # second sandbox shows in editor; scroll resets to display first sandbox screen-should-contain [ @@ -244,7 +244,7 @@ scenario deleting-final-sandbox-after-scroll [ trace-until 100/app # trace too long assume-screen 50/width, 10/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes and scroll to second assume-console [ @@ -256,7 +256,7 @@ scenario deleting-final-sandbox-after-scroll [ press page-down press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -271,7 +271,7 @@ scenario deleting-final-sandbox-after-scroll [ left-click 2, 34 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # implicitly scroll up to first sandbox screen-should-contain [ @@ -291,7 +291,7 @@ scenario deleting-updates-sandbox-count [ trace-until 100/app # trace too long assume-screen 50/width, 10/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes assume-console [ @@ -301,7 +301,7 @@ scenario deleting-updates-sandbox-count [ type [add 1, 1] press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -321,7 +321,7 @@ scenario deleting-updates-sandbox-count [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # shouldn't go past last sandbox screen-should-contain [ diff --git a/sandbox/008-sandbox-edit.mu b/sandbox/008-sandbox-edit.mu index 7cf1ad53..533e664c 100644 --- a/sandbox/008-sandbox-edit.mu +++ b/sandbox/008-sandbox-edit.mu @@ -5,11 +5,11 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ trace-until 100/app # trace too long assume-screen 50/width, 10/height # run something - env:&:environment <- new-programming-environment screen:&:screen, [add 2, 2] + env:&:environment <- new-programming-environment screen, [add 2, 2] assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -25,7 +25,7 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ left-click 3, 4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # it pops back into editor screen-should-contain [ @@ -39,7 +39,7 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ type [0] ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . @@ -105,12 +105,12 @@ scenario sandbox-with-print-can-be-edited [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # run a print instruction - env:&:environment <- new-programming-environment screen:&:screen, [print-integer screen, 4] + env:&:environment <- new-programming-environment screen, [print-integer screen, 4] # run the sandbox assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -131,7 +131,7 @@ scenario sandbox-with-print-can-be-edited [ left-click 3, 18 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . run (F4) . @@ -147,7 +147,7 @@ scenario editing-sandbox-after-scrolling-resets-scroll [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes and scroll to second assume-console [ @@ -159,7 +159,7 @@ scenario editing-sandbox-after-scrolling-resets-scroll [ press page-down press page-down ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -174,7 +174,7 @@ scenario editing-sandbox-after-scrolling-resets-scroll [ left-click 2, 10 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # second sandbox shows in editor; scroll resets to display first sandbox screen-should-contain [ @@ -194,7 +194,7 @@ scenario editing-sandbox-updates-sandbox-count [ trace-until 100/app # trace too long assume-screen 50/width, 20/height # initialize environment - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] render-all screen, env, render # create 2 sandboxes and scroll to second assume-console [ @@ -204,7 +204,7 @@ scenario editing-sandbox-updates-sandbox-count [ type [add 1, 1] press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -221,7 +221,7 @@ scenario editing-sandbox-updates-sandbox-count [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # no change in contents screen-should-contain [ @@ -241,7 +241,7 @@ scenario editing-sandbox-updates-sandbox-count [ press page-down ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # screen should show just final sandbox screen-should-contain [ diff --git a/sandbox/009-sandbox-test.mu b/sandbox/009-sandbox-test.mu index aebb34c2..eb7fc274 100644 --- a/sandbox/009-sandbox-test.mu +++ b/sandbox/009-sandbox-test.mu @@ -9,12 +9,12 @@ scenario sandbox-click-on-result-toggles-color-to-green [ recipe foo [ reply 4 ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] # run it assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes screen-should-contain [ . run (F4) . . . @@ -30,7 +30,7 @@ recipe foo [ left-click 5, 21 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] # color toggles to green screen-should-contain-in-color 2/green, [ @@ -45,7 +45,7 @@ recipe foo [ # cursor should remain unmoved run [ cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] screen-should-contain [ . run (F4) . @@ -67,7 +67,7 @@ recipe foo [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, new-recipes + event-loop screen, console, env, new-recipes ] # result turns red screen-should-contain-in-color 1/red, [ diff --git a/sandbox/010-sandbox-trace.mu b/sandbox/010-sandbox-trace.mu index b921c15d..5116b43b 100644 --- a/sandbox/010-sandbox-trace.mu +++ b/sandbox/010-sandbox-trace.mu @@ -4,12 +4,12 @@ scenario sandbox-click-on-code-toggles-app-trace [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 10/height - env:&:environment <- new-programming-environment screen:&:screen, [stash [abc]] + env:&:environment <- new-programming-environment screen, [stash [abc]] # run a stash instruction assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -24,9 +24,9 @@ scenario sandbox-click-on-code-toggles-app-trace [ left-click 4, 21 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env cursor:char <- copy 9251/␣ - print screen:&:screen, cursor + print screen, cursor ] # trace now printed and cursor shouldn't have budged screen-should-contain [ @@ -50,8 +50,8 @@ scenario sandbox-click-on-code-toggles-app-trace [ left-click 4, 25 ] run [ - event-loop screen:&:screen, console:&:console, env - print screen:&:screen, cursor + event-loop screen, console, env + print screen, cursor ] # trace hidden again screen-should-contain [ @@ -75,8 +75,8 @@ add 2, 2] assume-console [ press F4 ] - env:&:environment <- new-programming-environment screen:&:screen, sandbox - event-loop screen:&:screen, console:&:console, env + env:&:environment <- new-programming-environment screen, sandbox + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -93,7 +93,7 @@ add 2, 2] left-click 4, 21 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # trace now printed above result screen-should-contain [ @@ -114,13 +114,13 @@ scenario clicking-on-app-trace-does-nothing [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 10/height - env:&:environment <- new-programming-environment screen:&:screen, [stash 123456789] + env:&:environment <- new-programming-environment screen, [stash 123456789] # create and expand the trace assume-console [ press F4 left-click 4, 1 ] - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env screen-should-contain [ . run (F4) . . . @@ -134,7 +134,7 @@ scenario clicking-on-app-trace-does-nothing [ left-click 5, 7 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # no change; doesn't die screen-should-contain [ diff --git a/sandbox/011-errors.mu b/sandbox/011-errors.mu index 9ca8ab6d..b420ed6b 100644 --- a/sandbox/011-errors.mu +++ b/sandbox/011-errors.mu @@ -132,12 +132,12 @@ scenario run-shows-errors-in-get [ recipe foo [ get 123:num, foo:offset ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] screen-should-contain [ . errors found run (F4) . @@ -159,7 +159,7 @@ scenario run-updates-status-with-first-erroneous-sandbox [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 20/height - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] assume-console [ # create invalid sandbox 1 type [get foo, x:offset] @@ -169,7 +169,7 @@ scenario run-updates-status-with-first-erroneous-sandbox [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, [] + event-loop screen, console, env, [] ] # status line shows that error is in first sandbox screen-should-contain [ @@ -181,7 +181,7 @@ scenario run-updates-status-with-first-erroneous-sandbox-2 [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 20/height - env:&:environment <- new-programming-environment screen:&:screen, [] + env:&:environment <- new-programming-environment screen, [] assume-console [ # create invalid sandbox 2 type [get foo, x:offset] @@ -194,7 +194,7 @@ scenario run-updates-status-with-first-erroneous-sandbox-2 [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, [] + event-loop screen, console, env, [] ] # status line shows that error is in second sandbox screen-should-contain [ @@ -206,11 +206,11 @@ scenario run-hides-errors-from-past-sandboxes [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 20/height - env:&:environment <- new-programming-environment screen:&:screen, [get foo, x:offset] # invalid + env:&:environment <- new-programming-environment screen, [get foo, x:offset] # invalid assume-console [ press F4 # generate error ] - event-loop screen:&:screen, console:&:console, env, [] + event-loop screen, console, env, [] assume-console [ left-click 3, 10 press ctrl-k @@ -218,7 +218,7 @@ scenario run-hides-errors-from-past-sandboxes [ press F4 # update sandbox ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # error should disappear screen-should-contain [ @@ -244,11 +244,11 @@ load-ingredients y:&:num <- copy 0 z <- add x, y ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo 2] + env:&:environment <- new-programming-environment screen, [foo 2] assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes screen-should-contain [ . errors found (0) run (F4) . . . @@ -265,7 +265,7 @@ z <- add x, y press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] # error should remain unchanged screen-should-contain [ @@ -291,12 +291,12 @@ scenario run-avoids-spurious-errors-on-reloading-shape-shifting-recipes [ # call code that uses other variants of it, but not it itself sandbox:text <- new [x:&:list:num <- copy 0 to-text x] - env:&:environment <- new-programming-environment screen:&:screen, sandbox + env:&:environment <- new-programming-environment screen, sandbox # run it once assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes # no errors anywhere on screen (can't check anything else, since to-text will return an address) screen-should-contain-in-color 1/red, [ . . @@ -314,7 +314,7 @@ to-text x] press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] # still no errors screen-should-contain-in-color 1/red, [ @@ -338,12 +338,12 @@ scenario run-shows-missing-type-errors [ recipe foo [ x <- copy 0 ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] screen-should-contain [ . errors found run (F4) . @@ -364,12 +364,12 @@ scenario run-shows-unbalanced-bracket-errors [ recipe foo \\[ x <- copy 0 ] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] screen-should-contain [ . errors found run (F4) . @@ -394,12 +394,12 @@ recipe foo [ x:&:point <- new point:type get x:&:point, 1:offset ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] screen-should-contain [ . errors found run (F4) . @@ -423,12 +423,12 @@ recipe foo [ y:&:point <- new point:type get *y:&:point, x:num ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] screen-should-contain [ . errors found run (F4) . @@ -451,11 +451,11 @@ recipe foo [ local-scope x:num <- copy y:num ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo] + env:&:environment <- new-programming-environment screen, [foo] assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes screen-should-contain [ . errors found run (F4) . . . @@ -469,7 +469,7 @@ recipe foo [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] screen-should-contain [ . errors found run (F4) . @@ -485,12 +485,12 @@ scenario run-instruction-and-print-errors [ local-scope trace-until 100/app # trace too long assume-screen 50/width, 15/height - env:&:environment <- new-programming-environment screen:&:screen, [get 1:&:point, 1:offset] + env:&:environment <- new-programming-environment screen, [get 1:&:point, 1:offset] assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # check that screen prints error message in red screen-should-contain [ @@ -523,14 +523,14 @@ scenario run-instruction-and-print-errors-only-once [ assume-screen 50/width, 10/height # editor contains an illegal instruction sandbox:text <- new [get 1234:num, foo:offset] - env:&:environment <- new-programming-environment screen:&:screen, sandbox + env:&:environment <- new-programming-environment screen, sandbox # run the code in the editors multiple times assume-console [ press F4 press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] # check that screen prints error message just once screen-should-contain [ @@ -555,13 +555,13 @@ scenario sandbox-can-handle-infinite-loop [ sandbox:text <- new [{ loop }] - env:&:environment <- new-programming-environment screen:&:screen, sandbox + env:&:environment <- new-programming-environment screen, sandbox # run the sandbox assume-console [ press F4 ] run [ - event-loop screen:&:screen, console:&:console, env + event-loop screen, console, env ] screen-should-contain [ . errors found (0) run (F4) . @@ -590,12 +590,12 @@ stash [dividing by], b _, c:num <- divide-with-remainder a, b reply b ]] - env:&:environment <- new-programming-environment screen:&:screen, [foo 4, 0] + env:&:environment <- new-programming-environment screen, [foo 4, 0] # run assume-console [ press F4 ] - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes # screen prints error message screen-should-contain [ . errors found (0) run (F4) . @@ -613,7 +613,7 @@ reply b left-click 4, 15 ] run [ - event-loop screen:&:screen, console:&:console, env, recipes + event-loop screen, console, env, recipes ] # screen should expand trace screen-should-contain [ diff --git a/sandbox/012-editor-undo.mu b/sandbox/012-editor-undo.mu index 0b13de25..ce8c9e21 100644 --- a/sandbox/012-editor-undo.mu +++ b/sandbox/012-editor-undo.mu @@ -102,18 +102,18 @@ scenario editor-can-undo-typing [ local-scope # create an editor and type a character assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e assume-console [ type [0] ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # character should be gone screen-should-contain [ @@ -127,7 +127,7 @@ scenario editor-can-undo-typing [ type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -232,18 +232,18 @@ scenario editor-can-undo-typing-multiple [ local-scope # create an editor and type multiple characters assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e assume-console [ type [012] ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # all characters must be gone screen-should-contain [ @@ -258,13 +258,13 @@ scenario editor-can-undo-typing-multiple-2 [ local-scope # create an editor with some text assume-screen 10/width, 5/height - e:&:editor <- new-editor [a], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [a], screen, 0/left, 10/right editor-render screen, e # type some characters assume-console [ type [012] ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .012a . @@ -276,7 +276,7 @@ scenario editor-can-undo-typing-multiple-2 [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # back to original text screen-should-contain [ @@ -290,7 +290,7 @@ scenario editor-can-undo-typing-multiple-2 [ type [3] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -304,14 +304,14 @@ scenario editor-can-undo-typing-enter [ local-scope # create an editor with some text assume-screen 10/width, 5/height - e:&:editor <- new-editor [ abc], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [ abc], screen, 0/left, 10/right editor-render screen, e # new line assume-console [ left-click 1, 8 press enter ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . . abc . @@ -331,7 +331,7 @@ scenario editor-can-undo-typing-enter [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset @@ -351,7 +351,7 @@ scenario editor-can-undo-typing-enter [ type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -367,13 +367,13 @@ scenario editor-redo-typing [ local-scope # create an editor, type something, undo assume-screen 10/width, 5/height - e:&:editor <- new-editor [a], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [a], screen, 0/left, 10/right editor-render screen, e assume-console [ type [012] press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .a . @@ -385,7 +385,7 @@ scenario editor-redo-typing [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # all characters must be back screen-should-contain [ @@ -399,7 +399,7 @@ scenario editor-redo-typing [ type [3] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -431,13 +431,13 @@ scenario editor-redo-typing-empty [ local-scope # create an editor, type something, undo assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e assume-console [ type [012] press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . . . @@ -449,7 +449,7 @@ scenario editor-redo-typing-empty [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # all characters must be back screen-should-contain [ @@ -463,7 +463,7 @@ scenario editor-redo-typing-empty [ type [3] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -480,18 +480,18 @@ scenario editor-work-clears-redo-stack [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e assume-console [ type [1] press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # do some more work assume-console [ type [0] ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .0abc . @@ -504,7 +504,7 @@ ghi] press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # nothing should happen screen-should-contain [ @@ -520,7 +520,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ local-scope # create an editor assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e # insert some text and tabs, hit enter, some more text and tabs assume-console [ @@ -532,7 +532,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press tab type [efg] ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . . ab cd . @@ -551,7 +551,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # typing in second line deleted, but not indent 3:num/raw <- get *e, cursor-row:offset @@ -572,7 +572,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # indent and newline deleted 3:num/raw <- get *e, cursor-row:offset @@ -592,7 +592,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # empty screen 3:num/raw <- get *e, cursor-row:offset @@ -612,7 +612,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # first line inserted 3:num/raw <- get *e, cursor-row:offset @@ -632,7 +632,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # newline and indent inserted 3:num/raw <- get *e, cursor-row:offset @@ -653,7 +653,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # indent and newline deleted 3:num/raw <- get *e, cursor-row:offset @@ -680,19 +680,19 @@ scenario editor-can-undo-touch [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor assume-console [ left-click 3, 1 ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # click undone 3:num/raw <- get *e, cursor-row:offset @@ -706,7 +706,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -771,20 +771,20 @@ scenario editor-can-undo-left-arrow [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor assume-console [ left-click 3, 1 press left-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -798,7 +798,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -816,14 +816,14 @@ scenario editor-can-undo-up-arrow [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor assume-console [ left-click 3, 1 press up-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset memory-should-contain [ @@ -835,7 +835,7 @@ ghi] press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -849,7 +849,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -867,20 +867,20 @@ scenario editor-can-undo-down-arrow [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor assume-console [ left-click 2, 1 press down-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -894,7 +894,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -912,20 +912,20 @@ scenario editor-can-undo-ctrl-a [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor, then to start of line assume-console [ left-click 2, 1 press ctrl-a ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -939,7 +939,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -957,20 +957,20 @@ scenario editor-can-undo-home [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor, then to start of line assume-console [ left-click 2, 1 press home ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -984,7 +984,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1002,20 +1002,20 @@ scenario editor-can-undo-ctrl-e [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor, then to start of line assume-console [ left-click 2, 1 press ctrl-e ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -1029,7 +1029,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1047,20 +1047,20 @@ scenario editor-can-undo-end [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor, then to start of line assume-console [ left-click 2, 1 press end ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # undo assume-console [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves back 3:num/raw <- get *e, cursor-row:offset @@ -1074,7 +1074,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1092,7 +1092,7 @@ scenario editor-can-undo-multiple-arrows-in-the-same-direction [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # move the cursor assume-console [ @@ -1101,7 +1101,7 @@ ghi] press right-arrow press up-arrow ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset memory-should-contain [ @@ -1113,7 +1113,7 @@ ghi] press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # up-arrow is undone 3:num/raw <- get *e, cursor-row:offset @@ -1127,7 +1127,7 @@ ghi] press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # both right-arrows are undone 3:num/raw <- get *e, cursor-row:offset @@ -1147,19 +1147,19 @@ scenario editor-redo-touch [ contents:text <- new [abc def ghi] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e assume-console [ left-click 3, 1 press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e # redo assume-console [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # cursor moves to left-click 3:num/raw <- get *e, cursor-row:offset @@ -1173,7 +1173,7 @@ ghi] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1202,14 +1202,14 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ local-scope # create an editor, type some text, move the cursor, type some more text assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e assume-console [ type [abc] left-click 1, 1 type [d] ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset screen-should-contain [ @@ -1227,7 +1227,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1247,7 +1247,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1267,7 +1267,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1287,7 +1287,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1307,7 +1307,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1328,7 +1328,7 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] @@ -1351,7 +1351,7 @@ scenario editor-can-undo-and-redo-backspace [ local-scope # create an editor assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e # insert some text and hit backspace assume-console [ @@ -1359,7 +1359,7 @@ scenario editor-can-undo-and-redo-backspace [ press backspace press backspace ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .a . @@ -1377,7 +1377,7 @@ scenario editor-can-undo-and-redo-backspace [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset @@ -1396,7 +1396,7 @@ scenario editor-can-undo-and-redo-backspace [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset @@ -1496,7 +1496,7 @@ scenario editor-can-undo-and-redo-delete [ local-scope # create an editor assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e # insert some text and hit delete and backspace a few times assume-console [ @@ -1507,7 +1507,7 @@ scenario editor-can-undo-and-redo-delete [ press delete press delete ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .af . @@ -1525,7 +1525,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset @@ -1544,7 +1544,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset @@ -1563,7 +1563,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset @@ -1582,7 +1582,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # first line inserted 3:num/raw <- get *e, cursor-row:offset @@ -1602,7 +1602,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # first line inserted 3:num/raw <- get *e, cursor-row:offset @@ -1622,7 +1622,7 @@ scenario editor-can-undo-and-redo-delete [ press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # first line inserted 3:num/raw <- get *e, cursor-row:offset @@ -1687,14 +1687,14 @@ scenario editor-can-undo-and-redo-ctrl-k [ assume-screen 10/width, 5/height contents:text <- new [abc def] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # insert some text and hit delete and backspace a few times assume-console [ left-click 1, 1 press ctrl-k ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .a . @@ -1713,7 +1713,7 @@ def] press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1733,7 +1733,7 @@ def] press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # first line inserted screen-should-contain [ @@ -1754,7 +1754,7 @@ def] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1790,14 +1790,14 @@ scenario editor-can-undo-and-redo-ctrl-u [ assume-screen 10/width, 5/height contents:text <- new [abc def] - e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor contents, screen, 0/left, 10/right editor-render screen, e # insert some text and hit delete and backspace a few times assume-console [ left-click 1, 2 press ctrl-u ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .c . @@ -1816,7 +1816,7 @@ def] press ctrl-z ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1836,7 +1836,7 @@ def] press ctrl-y ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] # first line inserted screen-should-contain [ @@ -1857,7 +1857,7 @@ def] type [1] ] run [ - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e ] screen-should-contain [ . . @@ -1890,7 +1890,7 @@ scenario editor-can-undo-and-redo-ctrl-u-2 [ local-scope # create an editor assume-screen 10/width, 5/height - e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right + e:&:editor <- new-editor [], screen, 0/left, 10/right editor-render screen, e # insert some text and hit delete and backspace a few times assume-console [ @@ -1898,7 +1898,7 @@ scenario editor-can-undo-and-redo-ctrl-u-2 [ press ctrl-u press ctrl-z ] - editor-event-loop screen:&:screen, console:&:console, e + editor-event-loop screen, console, e screen-should-contain [ . . .abc . |