about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-06-29 23:52:39 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-29 23:52:39 -0700
commitb30424f35e1c13b39306a863c3c89fb4a5af83ad (patch)
treeae273fe57db03223b4bbac69686e612f735763b7
parent0392bc2c9d2b08c3c309353ac42694b9cdf973e4 (diff)
downloadmu-b30424f35e1c13b39306a863c3c89fb4a5af83ad.tar.gz
1680
-rw-r--r--edit.mu24
1 files changed, 24 insertions, 0 deletions
diff --git a/edit.mu b/edit.mu
index f5a06345..40576e3c 100644
--- a/edit.mu
+++ b/edit.mu
@@ -520,6 +520,11 @@ recipe handle-event [
       at-wrap?:boolean <- equal cursor-column:address:number/deref, wrap-column:number
       break-unless at-wrap?:boolean
       # and if character after next isn't newline
+#?       $print [aaa] #? 1
+      next-next:address:duplex-list <- next-duplex next:address:duplex-list
+      break-unless next-next:address:duplex-list
+      next-next-next:address:duplex-list <- next-duplex next-next:address:duplex-list
+      break-unless next-next-next:address:duplex-list
       # TODO
       cursor-row:address:number/deref <- add cursor-row:address:number/deref, 1:literal
       cursor-column:address:number/deref <- copy 0:literal
@@ -1117,6 +1122,25 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [
   ]
 ]
 
+scenario editor-does-not-wrap-cursor-when-line-does-not-wrap [
+  assume-screen 10:literal/width, 5:literal/height
+  1:address:array:character <- new [abcde]
+  2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0:literal/top, 0:literal/left, 5:literal/right
+  assume-console [
+    left-click 0, 3
+    press 65514  # right arrow
+  ]
+  run [
+    event-loop screen:address, console:address, 2:address:editor-data
+    3:number <- get 2:address:editor-data/deref, cursor-row:offset
+    4:number <- get 2:address:editor-data/deref, cursor-column:offset
+  ]
+  memory-should-contain [
+    3 <- 0
+    4 <- 4
+  ]
+]
+
 scenario editor-moves-cursor-to-next-line-with-right-arrow-at-end-of-line [
   assume-screen 10:literal/width, 5:literal/height
   1:address:array:character <- new [abc