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.mu32
1 files changed, 32 insertions, 0 deletions
diff --git a/edit/003-shortcuts.mu b/edit/003-shortcuts.mu
index ae9609a7..77627357 100644
--- a/edit/003-shortcuts.mu
+++ b/edit/003-shortcuts.mu
@@ -2930,6 +2930,38 @@ cdef]
   ]
 ]
 
+scenario editor-stops-scrolling-once-bottom-is-visible [
+  local-scope
+  # screen has 1 line for menu + 3 lines
+  assume-screen 10/width, 4/height
+  # initialize editor with 2 lines
+  s:text <- new [a
+b]
+  e:&:editor <- new-editor s, 0/left, 10/right
+  editor-render screen, e
+  screen-should-contain [
+    .          .
+    .a         .
+    .b         .
+    .┈┈┈┈┈┈┈┈┈┈.
+  ]
+  # position cursor at last line, then try to move further down
+  assume-console [
+    left-click 3, 0
+    press down-arrow
+  ]
+  run [
+    editor-event-loop screen, console, e
+  ]
+  # no change since the bottom border was already visible
+  screen-should-contain [
+    .          .
+    .a         .
+    .b         .
+    .┈┈┈┈┈┈┈┈┈┈.
+  ]
+]
+
 scenario editor-scrolls-down-on-newline [
   local-scope
   assume-screen 5/width, 4/height