From 0f0be736fbe118612ad0b8f2bd84c2e7f4c35ade Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 27 Jun 2017 11:16:36 -0700 Subject: 3962 Yet another regression, this time cascading from commit 3953. My scenario wasn't actually testing what I thought it was testing. --- sandbox/003-shortcuts.mu | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'sandbox') diff --git a/sandbox/003-shortcuts.mu b/sandbox/003-shortcuts.mu index adee48a7..fb1c6e97 100644 --- a/sandbox/003-shortcuts.mu +++ b/sandbox/003-shortcuts.mu @@ -390,7 +390,6 @@ def delete-at-cursor editor:&:editor, screen:&:screen -> go-render?:bool, delete at-right?:bool <- greater-or-equal curr-column, screen-width return-if at-right?, 1/go-render break-unless curr - # newline? done. currc:char <- get *curr, value:offset at-newline?:bool <- equal currc, 10/newline break-if at-newline? @@ -1332,7 +1331,7 @@ after [ move-to-next-line?:bool <- equal k, 65516/down-arrow break-unless move-to-next-line? - editor <- move-to-next-line editor, screen-height + move-to-next-line editor, screen-height undo-coalesce-tag:num <- copy 4/down-arrow return @@ -1376,6 +1375,9 @@ def move-to-next-line editor:&:editor, screen-height:num -> editor:&:editor [ { next:&:duplex-list:char <- next before-cursor break-unless next + c:char <- get *next, value:offset + at-newline?:bool <- equal c, 10/newline + break-if at-newline? done?:bool <- greater-or-equal cursor-column, target-column break-if done? cursor-column <- add cursor-column, 1 @@ -1390,13 +1392,16 @@ def move-to-next-line editor:&:editor, screen-height:num -> editor:&:editor [ scenario editor-adjusts-column-at-next-line [ local-scope assume-screen 10/width, 5/height - s:text <- new [abc -de] + # second line is shorter than first + s:text <- new [abcde +fg +hi] e:&:editor <- new-editor s, 0/left, 10/right editor-render screen, e $clear-trace + # move to end of first line, then press down assume-console [ - left-click 1, 3 + left-click 1, 8 press down-arrow ] run [ @@ -1404,6 +1409,7 @@ de] 3:num/raw <- get *e, cursor-row:offset 4:num/raw <- get *e, cursor-column:offset ] + # cursor doesn't go vertically down, it goes to end of shorter line memory-should-contain [ 3 <- 2 4 <- 2 @@ -1417,10 +1423,10 @@ de] ] screen-should-contain [ . . - .abc . - .de0 . + .abcde . + .fg0 . + .hi . .┈┈┈┈┈┈┈┈┈┈. - . . ] ] -- cgit 1.4.1-2-gfad0