From cebb5fca612321f9436f324d6b95e94b0f1ac614 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 17 Sep 2016 18:03:26 -0700 Subject: 3397 --- html/edit/002-typing.mu.html | 196 +++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 98 deletions(-) (limited to 'html/edit/002-typing.mu.html') diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index 815f5fab..469acd95 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -41,12 +41,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color local-scope load-ingredients open-console - editor:&:editor-data <- new-editor text, 0/screen, 5/left, 45/right + editor:&:editor <- new-editor text, 0/screen, 5/left, 45/right editor-event-loop 0/screen, 0/console, editor close-console ] -def editor-event-loop screen:&:screen, console:&:console, editor:&:editor-data -> screen:&:screen, console:&:console, editor:&:editor-data [ +def editor-event-loop screen:&:screen, console:&:console, editor:&:editor -> screen:&:screen, console:&:console, editor:&:editor [ local-scope load-ingredients { @@ -80,7 +80,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # process click, return if it was on current editor -def move-cursor-in-editor screen:&:screen, editor:&:editor-data, t:touch-event -> in-focus?:bool, editor:&:editor-data [ +def move-cursor-in-editor screen:&:screen, editor:&:editor, t:touch-event -> in-focus?:bool, editor:&:editor [ local-scope load-ingredients return-unless editor, 0/false @@ -105,7 +105,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # Variant of 'render' that only moves the cursor (coordinates and # before-cursor). If it's past the end of a line, it 'slides' it left. If it's # past the last line it positions at end of last line. -def snap-cursor screen:&:screen, editor:&:editor-data, target-row:num, target-column:num -> editor:&:editor-data [ +def snap-cursor screen:&:screen, editor:&:editor, target-row:num, target-column:num -> editor:&:editor [ local-scope load-ingredients return-unless editor @@ -128,7 +128,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color break-unless curr off-screen?:bool <- greater-or-equal row, screen-height break-if off-screen? - # update editor-data.before-cursor + # update editor.before-cursor # Doing so at the start of each iteration ensures it stays one step behind # the current character. { @@ -196,7 +196,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # Process an event 'e' and try to minimally update the screen. # Set 'go-render?' to true to indicate the caller must perform a non-minimal update. -def handle-keyboard-event screen:&:screen, editor:&:editor-data, e:event -> screen:&:screen, editor:&:editor-data, go-render?:bool [ +def handle-keyboard-event screen:&:screen, editor:&:editor, e:event -> screen:&:screen, editor:&:editor, go-render?:bool [ local-scope load-ingredients go-render? <- copy 0/false @@ -236,7 +236,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color return ] -def insert-at-cursor editor:&:editor-data, c:char, screen:&:screen -> editor:&:editor-data, screen:&:screen, go-render?:bool [ +def insert-at-cursor editor:&:editor, c:char, screen:&:screen -> editor:&:editor, screen:&:screen, go-render?:bool [ local-scope load-ingredients before-cursor:&:duplex-list:char <- get *editor, before-cursor:offset @@ -302,7 +302,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # helper for tests -def editor-render screen:&:screen, editor:&:editor-data -> screen:&:screen, editor:&:editor-data [ +def editor-render screen:&:screen, editor:&:editor -> screen:&:screen, editor:&:editor [ local-scope load-ingredients left:num <- get *editor, left:offset @@ -318,11 +318,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-handles-empty-event-queue [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor assume-console [] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -335,16 +335,16 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-handles-mouse-clicks [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace assume-console [ left-click 1, 1 # on the 'b' ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] screen-should-contain [ . . @@ -362,15 +362,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-handles-mouse-clicks-outside-text [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&: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, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] memory-should-contain [ 3 <- 1 # cursor row @@ -383,15 +383,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abc def] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&: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, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] memory-should-contain [ 3 <- 1 # cursor row @@ -404,15 +404,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abc def] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right $clear-trace assume-console [ left-click 3, 7 # below text ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] memory-should-contain [ 3 <- 2 # cursor row @@ -425,17 +425,17 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abc] # editor occupies only left half of screen - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right + editor-render screen, 2:&:editor $clear-trace assume-console [ # click on right half of screen left-click 3, 8 ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] screen-should-contain [ . . @@ -453,17 +453,17 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-handles-mouse-clicks-in-menu-area [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right + editor-render screen, 2:&:editor $clear-trace assume-console [ # click on first, 'menu' row left-click 0, 3 ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] # no change to cursor memory-should-contain [ @@ -475,14 +475,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-inserts-characters-into-empty-editor [ assume-screen 10/width, 5/height 1:text <- new [] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right + editor-render screen, 2:&:editor $clear-trace assume-console [ type [abc] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -496,8 +496,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-inserts-characters-at-cursor [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace # type two letters at different places assume-console [ @@ -506,7 +506,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type [d] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -520,15 +520,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-inserts-characters-at-cursor-2 [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace assume-console [ left-click 1, 5 # right of last line type [d] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -543,15 +543,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abc d] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace assume-console [ left-click 1, 5 # right of non-last line type [e] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -566,15 +566,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-inserts-characters-at-cursor-3 [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace assume-console [ left-click 3, 5 # below all text type [d] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -589,15 +589,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abc d] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace assume-console [ left-click 3, 5 # below all text type [e] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -613,15 +613,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abc d] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right + editor-render screen, 2:&:editor $clear-trace assume-console [ left-click 3, 5 # below all text type [ef] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -636,13 +636,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-moves-cursor-after-inserting-characters [ assume-screen 10/width, 5/height 1:text <- new [ab] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right + editor-render screen, 2:&:editor assume-console [ type [01] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -657,14 +657,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-wraps-line-on-insert [ assume-screen 5/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right + editor-render screen, 2:&:editor # type a letter assume-console [ type [e] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] # no wrap yet screen-should-contain [ @@ -679,7 +679,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type [f] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] # now wrap screen-should-contain [ @@ -696,17 +696,17 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height 1:text <- new [abcdefg defg] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right - editor-render screen, 2:&:editor-data + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right + editor-render screen, 2:&:editor # type more text at the start assume-console [ left-click 3, 0 type [abc] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] # cursor is not wrapped memory-should-contain [ @@ -777,15 +777,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-wraps-cursor-after-inserting-characters-in-middle-of-line [ assume-screen 10/width, 5/height 1:text <- new [abcde] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right + 2:&:editor <- new-editor 1:text, screen:&: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, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] screen-should-contain [ . . @@ -806,7 +806,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create an editor containing two lines contents:text <- new [abc xyz] - 1:&:editor-data/raw <- new-editor contents, screen, 0/left, 5/right + 1:&:editor/raw <- new-editor contents, screen, 0/left, 5/right screen-should-contain [ . . .abc . @@ -818,7 +818,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type [de] # trigger wrap ] run [ - editor-event-loop screen:&:screen, console:&:console, 1:&:editor-data/raw + editor-event-loop screen:&:screen, console:&:console, 1:&:editor/raw ] screen-should-contain [ . . @@ -832,15 +832,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-wraps-cursor-to-left-margin [ assume-screen 10/width, 5/height 1:text <- new [abcde] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 2/left, 7/right + 2:&:editor <- new-editor 1:text, screen:&: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, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] screen-should-contain [ . . @@ -857,7 +857,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # if newline, move cursor to start of next line, and maybe align indent with previous line -container editor-data [ +container editor [ indent?:bool ] @@ -868,13 +868,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-moves-cursor-down-after-inserting-newline [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right assume-console [ type [0 1] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -897,7 +897,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color } ] -def insert-new-line-and-indent editor:&:editor-data, screen:&:screen -> editor:&:editor-data, screen:&:screen, go-render?:bool [ +def insert-new-line-and-indent editor:&:editor, screen:&:screen -> editor:&:editor, screen:&:screen, go-render?:bool [ local-scope load-ingredients cursor-row:num <- get *editor, cursor-row:offset @@ -974,13 +974,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-moves-cursor-down-after-inserting-newline-2 [ assume-screen 10/width, 5/height 1:text <- new [abc] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 1/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&:screen, 1/left, 10/right assume-console [ type [0 1] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] screen-should-contain [ . . @@ -994,7 +994,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario editor-clears-previous-line-completely-after-inserting-newline [ assume-screen 10/width, 5/height 1:text <- new [abcde] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 5/right + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right assume-console [ press enter ] @@ -1006,7 +1006,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color . . ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data + editor-event-loop screen:&:screen, console:&:console, 2:&:editor ] # line should be fully cleared screen-should-contain [ @@ -1023,7 +1023,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color 1:text <- new [ab cd ef] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' assume-console [ left-click 2, 8 @@ -1031,9 +1031,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] # cursor should be below start of previous line memory-should-contain [ @@ -1047,7 +1047,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color 1:text <- new [ab cd ef] - 2:&:editor-data <- new-editor 1:text, screen:&:screen, 0/left, 10/right + 2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' surrounded by paste markers assume-console [ left-click 2, 8 @@ -1056,9 +1056,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press 65506 # end paste ] run [ - editor-event-loop screen:&:screen, console:&:console, 2:&:editor-data - 3:num <- get *2:&:editor-data, cursor-row:offset - 4:num <- get *2:&:editor-data, cursor-column:offset + editor-event-loop screen:&:screen, console:&:console, 2:&:editor + 3:num <- get *2:&:editor, cursor-row:offset + 4:num <- get *2:&:editor, cursor-column:offset ] # cursor should be below start of previous line memory-should-contain [ @@ -1110,7 +1110,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color } screen <- move-cursor screen, row, x { - continue?:bool <- lesser-or-equal x, right # right is inclusive, to match editor-data semantics + continue?:bool <- lesser-or-equal x, right # right is inclusive, to match editor semantics break-unless continue? print screen, style, color, bg-color x <- add x, 1 -- cgit 1.4.1-2-gfad0