bugfix: deleting a selection spanning pages

[?]
Jun 26, 2022, 11:34 PM
4J2L6JMR7NZBGCNX63CL2E3AIB7P7QTCC7QQBPNAEPQ7ISQXL7EQC

Dependencies

  • [2] VG75U7IM bugfix: typing should delete highlighted text
  • [*] LXTTOB33 extract a couple of files

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/4
    App.screen.init{width=120, height=60}
    Lines = load_array{'abc', 'def', 'ghi', 'jkl'}
    Line_width = App.screen.width
    Cursor1 = {line=3, pos=2}
    Screen_top1 = {line=2, pos=1}
    Screen_bottom1 = {}
    App.draw()
    local y = Margin_top
    App.screen.check(y, 'def', 'F - test_deleting_selection_may_scroll/baseline/screen:1')
    y = y + Line_height
    App.screen.check(y, 'ghi', 'F - test_deleting_selection_may_scroll/baseline/screen:2')
    y = y + Line_height
    App.screen.check(y, 'jkl', 'F - test_deleting_selection_may_scroll/baseline/screen:3')
    -- set up a selection starting above the currently displayed page
    Selection1 = {line=1, pos=2}
    -- delete selection
    App.run_after_keychord('backspace')
    -- page scrolls up
    check_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) then
    Screen_top1.line = Cursor1.line
    _,Screen_top1.pos = Text.pos_at_start_of_cursor_screen_line()
    end