about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-06-30 17:46:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-30 17:46:58 -0700
commit7ed2441bb547fb799bdd553e4f89c48fee7b60db (patch)
treef5c23b6e4d3a0da84ef113b0bb632806f4c22ef4
parentaf6d93142c7bc15c504d519db60cd5c16a0967f1 (diff)
downloadmu-7ed2441bb547fb799bdd553e4f89c48fee7b60db.tar.gz
1689
-rw-r--r--edit.mu22
1 files changed, 21 insertions, 1 deletions
diff --git a/edit.mu b/edit.mu
index 466b7b42..3c206bbd 100644
--- a/edit.mu
+++ b/edit.mu
@@ -234,7 +234,7 @@ recipe render [
 #?       $print row:number, [ ], column:number, [ ], right:number, [ 
 #? ] #? 1
       {
-        done?:boolean <- greater-or-equal column:number, right:number
+        done?:boolean <- greater-than column:number, right:number
         break-if done?:boolean
         print-character screen:address, 32:literal/space
         column:number <- add column:number, 1:literal
@@ -1117,6 +1117,26 @@ scenario editor-moves-cursor-down-after-inserting-newline [
   ]
 ]
 
+scenario editor-clears-previous-line-completely-after-inserting-newline [
+  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
+  # press just a 'newline'
+  assume-console [
+    type [
+]
+  ]
+  run [
+    event-loop screen:address, console:address, 2:address:editor-data
+  ]
+  # line should be fully cleared
+  screen-should-contain [
+    .          .
+    .abcde     .
+    .          .
+  ]
+]
+
 scenario editor-handles-backspace-key [
 #?   $print [=== new test
 #? ] #? 1