From 8641181d9fe8ad72f5b00a6909f468e6f7af16d7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 4 Aug 2015 19:35:30 -0700 Subject: 1932 --- edit.mu | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'edit.mu') diff --git a/edit.mu b/edit.mu index e5d43001..14a19e27 100644 --- a/edit.mu +++ b/edit.mu @@ -2566,6 +2566,69 @@ b] ] ] +scenario editor-starts-next-page-at-start-of-wrapped-line [ + # screen has 1 line for menu + 3 lines for text + assume-screen 10/width, 4/height + # editor contains a long last line + 1:address:array:character <- new [a +b +cdefgh] + # editor screen triggers wrap of last line + 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + # some part of last line is not displayed + screen-should-contain [ + . . + .a . + .b . + .cde↩ . + ] + # scroll down + assume-console [ + press 65518 # page-down + ] + run [ + editor-event-loop screen:address, console:address, 2:address:editor-data + ] + # screen shows entire wrapped line + screen-should-contain [ + . . + .cde↩ . + .fgh . + . . + ] +] + +scenario editor-starts-next-page-at-start-of-wrapped-line-2 [ + # screen has 1 line for menu + 3 lines for text + assume-screen 10/width, 4/height + # editor contains a very long line that occupies last two lines of screen + # and still has something left over + 1:address:array:character <- new [a +bcdefgh] + 2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0/left, 4/right + # some part of last line is not displayed + screen-should-contain [ + . . + .a . + .bcd↩ . + .efg↩ . + ] + # scroll down + assume-console [ + press 65518 # page-down + ] + run [ + editor-event-loop screen:address, console:address, 2:address:editor-data + ] + # screen shows entire wrapped line + screen-should-contain [ + . . + .bcd↩ . + .efg↩ . + .h . + ] +] + # ctrl-b/page-up - render previous page if it exists scenario editor-can-scroll-up [ -- cgit 1.4.1-2-gfad0