scrolling with up arrow

[?]
May 23, 2022, 11:35 PM
A2NV3WVOKBOWBCSV3K4I6MO5LSVSSUZVNH226HV2HDCOMSPRVSSAC

Dependencies

  • [2] MDXGMZU2 disable all debug prints
  • [3] 537TQ2QN some more logging
  • [4] JY4VK7L2 rename
  • [5] CVGE3SIG I feel confident now that page-down is working.
  • [6] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [7] QYIFOHW3 first test!
  • [8] WLHI7KD3 new globals: draw partial screen line up top
  • [9] S5VCAFKY couple of tests for cursor down
  • [10] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [11] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [12] YTSPVDZH first successful pagedown test, first bug found by test
  • [13] XOAHJ6M3 similar tests for cursor up
  • [14] MGT5FTJ3 first stab at supporting wrapping in cursor up
  • [15] JRGTJ2IW quite the frustrating bugfix
  • [16] IMEJA43L snapshot
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text.lua at line 32
    [3.2151][3.202:243](),[3.243][2.185:255]()
    -- don't update y above screen top
    if line_index > Screen_top1.line or pos >= Screen_top1.pos then
    [3.2151]
    [3.83]
    -- update y only after drawing the first screen line of screen top
    if line_index > Screen_top1.line or (line_index == Screen_top1.line and pos > Screen_top1.pos) then
  • replacement in text.lua at line 35
    [3.119][3.1:108]()
    if New_foo then print('text: new screen line', y, App.screen.height, screen_line_starting_pos) end
    [3.119]
    [3.255]
    --? print('text: new screen line', y, App.screen.height, screen_line_starting_pos)
  • replacement in text.lua at line 46
    [3.306][2.256:326]()
    if line_index > Screen_top1.line or pos >= Screen_top1.pos then
    [3.306]
    [2.326]
    if line_index > Screen_top1.line or (line_index == Screen_top1.line and pos > Screen_top1.pos) then
  • replacement in text.lua at line 56
    [3.427][3.152:220](),[3.152][3.152:220]()
    if line_index > Screen_top1.line or pos >= Screen_top1.pos then
    [3.427]
    [3.223]
    if line_index > Screen_top1.line or (line_index == Screen_top1.line and pos >= Screen_top1.pos) then
  • edit in text.lua at line 259
    [3.2740][3.2740:2750]()
    -- HERE
  • replacement in text.lua at line 359
    [3.5311][3.5311:5455]()
    -- display the lines 2/3/4 with the cursor on line 2
    App.screen.init{width=120, height=60}
    Lines = load_array{'abc', 'def', 'ghi', 'jkl'}
    [3.5311]
    [3.5455]
    -- display lines starting from the second screen line of line 3
    App.screen.init{width=25+30, height=60}
    Lines = load_array{'abc', 'def', 'ghi jkl', 'mno'}
  • replacement in text.lua at line 363
    [3.5487][3.5487:5547]()
    Cursor1 = {line=2, pos=1}
    Screen_top1 = {line=2, pos=1}
    [3.5487]
    [3.5547]
    Cursor1 = {line=3, pos=6}
    Screen_top1 = {line=3, pos=5}
  • replacement in text.lua at line 371
    [3.5718][3.5718:5936]()
    App.screen.check(y, 'def', 'F - test_up_arrow_scrolls_up_by_one_screen_line/baseline/screen:1')
    y = y + line_height
    App.screen.check(y, 'ghi', 'F - test_up_arrow_scrolls_up_by_one_screen_line/baseline/screen:2')
    [3.5718]
    [3.5936]
    App.screen.check(y, 'jkl', 'F - test_up_arrow_scrolls_up_by_one_screen_line/baseline/screen:1')
  • replacement in text.lua at line 373
    [3.5958][3.5958:6056]()
    App.screen.check(y, 'jkl', 'F - test_up_arrow_scrolls_up_by_one_screen_line/baseline/screen:3')
    [3.5958]
    [3.6056]
    App.screen.check(y, 'mno', 'F - test_up_arrow_scrolls_up_by_one_screen_line/baseline/screen:2')
  • replacement in text.lua at line 377
    [3.6177][3.6177:6266]()
    App.screen.check(y, 'abc', 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen:1')
    [3.6177]
    [3.6266]
    App.screen.check(y, 'ghi ', 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen:1')
  • replacement in text.lua at line 379
    [3.6288][3.6288:6377]()
    App.screen.check(y, 'def', 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen:2')
    [3.6288]
    [3.6377]
    App.screen.check(y, 'jkl', 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen:2')
  • replacement in text.lua at line 381
    [3.6399][3.6399:6668]()
    App.screen.check(y, 'ghi', 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen:3')
    check_eq(Screen_top1.line, 1, 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen_top')
    check_eq(Cursor1.line, 1, 'F - test_up_arrow_scrolls_up_by_one_screen_line/cursor')
    [3.6399]
    [3.2148]
    App.screen.check(y, 'mno', 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen:3')
    check_eq(Screen_top1.line, 3, 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen_top')
    check_eq(Screen_top1.pos, 1, 'F - test_up_arrow_scrolls_up_by_one_screen_line/screen_top')
    check_eq(Cursor1.line, 3, 'F - test_up_arrow_scrolls_up_by_one_screen_line/cursor')
    check_eq(Cursor1.pos, 1, 'F - test_up_arrow_scrolls_up_by_one_screen_line/cursor')