about summary refs log tree commit diff stats
path: root/edit/003-shortcuts.mu
diff options
context:
space:
mode:
Diffstat (limited to 'edit/003-shortcuts.mu')
-rw-r--r--edit/003-shortcuts.mu19
1 files changed, 13 insertions, 6 deletions
diff --git a/edit/003-shortcuts.mu b/edit/003-shortcuts.mu
index 77627357..6ffc9bcf 100644
--- a/edit/003-shortcuts.mu
+++ b/edit/003-shortcuts.mu
@@ -1419,6 +1419,9 @@ def move-to-next-line editor:&:editor, screen-height:num -> go-render?:bool, edi
     {
       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
@@ -1438,13 +1441,16 @@ def move-to-next-line editor:&:editor, screen-height:num -> go-render?:bool, edi
 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 [
@@ -1452,6 +1458,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
@@ -1465,10 +1472,10 @@ de]
   ]
   screen-should-contain [
     .          .
-    .abc       .
-    .de0       .
+    .abcde     .
+    .fg0       .
+    .hi        .
     .┈┈┈┈┈┈┈┈┈┈.
-    .          .
   ]
 ]