check for scroll when just typing
[?]
Jun 5, 2022, 3:29 PM
NZKYPBSKYJ7NQU7ABRHLYZ2P2P5V2UF76OLRURGTGRUB54R4SPBQCDependencies
- [2]
LXTTOB33extract a couple of files - [3]
CUIV2LE5some typos - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
WY3JD6W6bugfix - [*]
2RXZ3PGObeginning of a new approach to scroll+wrap - [*]
XNFTJHC4split keyboard handling between Text and Drawing
Change contents
- edit in text_tests.lua at line 81
App.draw() - edit in text_tests.lua at line 86
App.run_after_textinput('k')App.run_after_textinput('l') - edit in text_tests.lua at line 729
function test_typing_on_bottom_line_scrolls_down()io.write('\ntest_typing_on_bottom_line_scrolls_down')-- display a few lines with cursor on bottom lineApp.screen.init{width=25+30, height=60}Lines = load_array{'abc', 'def', 'ghi', 'jkl'}Line_width = App.screen.widthCursor1 = {line=3, pos=4}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}App.draw()local y = Margin_topApp.screen.check(y, 'abc', 'F - test_typing_on_bottom_line_scrolls_down/baseline/screen:1')y = y + Line_heightApp.screen.check(y, 'def', 'F - test_typing_on_bottom_line_scrolls_down/baseline/screen:2')y = y + Line_heightApp.screen.check(y, 'ghi', 'F - test_typing_on_bottom_line_scrolls_down/baseline/screen:3')-- after typing something the line wraps and the screen scrolls downApp.run_after_textinput('j')App.run_after_textinput('k')App.run_after_textinput('l')check_eq(Screen_top1.line, 2, 'F - test_typing_on_bottom_line_scrolls_down/screen_top')check_eq(Cursor1.line, 3, 'F - test_typing_on_bottom_line_scrolls_down/cursor:line')check_eq(Cursor1.pos, 7, 'F - test_typing_on_bottom_line_scrolls_down/cursor:pos')y = Margin_topApp.screen.check(y, 'def', 'F - test_typing_on_bottom_line_scrolls_down/screen:1')y = y + Line_heightApp.screen.check(y, 'ghijk', 'F - test_typing_on_bottom_line_scrolls_down/screen:2')y = y + Line_heightApp.screen.check(y, 'l', 'F - test_typing_on_bottom_line_scrolls_down/screen:3')end - edit in text_tests.lua at line 957
App.draw() - edit in text.lua at line 158
local scroll_down = Text.le1(Screen_bottom1, Cursor1) - edit in text.lua at line 160[7.763][8.513]
if scroll_down thenText.populate_screen_line_starting_pos(Cursor1.line)Text.snap_cursor_to_bottom_of_screen()end