bugfix: deleting a selection spanning pages
[?]
Jun 26, 2022, 11:34 PM
4J2L6JMR7NZBGCNX63CL2E3AIB7P7QTCC7QQBPNAEPQ7ISQXL7EQCDependencies
Change contents
- edit in text_tests.lua at line 320[2.525][4.2457]
function test_deleting_selection_may_scroll()io.write('\ntest_deleting_selection_may_scroll')-- display lines 2/3/4App.screen.init{width=120, height=60}Lines = load_array{'abc', 'def', 'ghi', 'jkl'}Line_width = App.screen.widthCursor1 = {line=3, pos=2}Screen_top1 = {line=2, pos=1}Screen_bottom1 = {}App.draw()local y = Margin_topApp.screen.check(y, 'def', 'F - test_deleting_selection_may_scroll/baseline/screen:1')y = y + Line_heightApp.screen.check(y, 'ghi', 'F - test_deleting_selection_may_scroll/baseline/screen:2')y = y + Line_heightApp.screen.check(y, 'jkl', 'F - test_deleting_selection_may_scroll/baseline/screen:3')-- set up a selection starting above the currently displayed pageSelection1 = {line=1, pos=2}-- delete selectionApp.run_after_keychord('backspace')-- page scrolls upcheck_eq(Screen_top1.line, 1, 'F - test_deleting_selection_may_scroll')check_eq(Lines[1].data, 'ahi', 'F - test_deleting_selection_may_scroll/data')end - edit in select.lua at line 136[4.47213][4.47213]
if Text.lt1(Cursor1, Screen_top1) thenScreen_top1.line = Cursor1.line_,Screen_top1.pos = Text.pos_at_start_of_cursor_screen_line()end