bugfix: pagedown was sometimes bouncing up

[?]
Aug 11, 2022, 5:56 AM
Y4SPXCM3PKARGUU22FNBEDRU7S6CJSNYVAA76JYH4I4EMMMKP6LQC

Dependencies

  • [2] ILOA5BYF separate data structure for each line's cache data
  • [3] LERERVPH keep one screen line of overlap on pagedown
  • [4] CVGE3SIG I feel confident now that page-down is working.
  • [5] GK47BBCY start passing left/right margins everywhere
  • [6] 3ZSUBI57 drop some redundant args from Text.draw
  • [7] MXA3RZYK deduce left/right from state where possible
  • [8] HGC5RGJP switch to line index in a function
  • [9] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [10] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [*] LXTTOB33 extract a couple of files
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • edit in text_tests.lua at line 1087
    [12.10095]
    [12.10095]
    function test_pagedown_never_moves_up()
    io.write('\ntest_pagedown_never_moves_up')
    -- draw the final screen line of a wrapping line
    App.screen.init{width=Editor_state.left+30, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc def ghi'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=9}
    Editor_state.screen_top1 = {line=1, pos=9}
    Editor_state.screen_bottom1 = {}
    edit.draw(Editor_state)
    -- pagedown makes no change
    edit.run_after_keychord(Editor_state, 'pagedown')
    check_eq(Editor_state.screen_top1.line, 1, 'F - test_pagedown_never_moves_up/screen_top:line')
    check_eq(Editor_state.screen_top1.pos, 9, 'F - test_pagedown_never_moves_up/screen_top:pos')
    end
  • replacement in text.lua at line 20
    [3.1818][3.104:141]()
    local screen_line_starting_pos = 1
    [3.1818]
    [2.3821]
    local screen_line_starting_pos = State.screen_top1.pos