bugfix in cursor positioning

akkartik
Feb 8, 2024, 10:29 AM
J7A5ROM3MKBKJYZ4WKOHGS74DLM6VSC7HXLZHRCIQEGZSNARCTIAC

Dependencies

  • [2] G54H3YG2 get rid of all bifold text
  • [3] EKKFWP4D bugfix: couple of margin-relative computations
  • [4] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [5] APYPFFS3 call edit rather than App callbacks in tests
  • [6] EMHRPJ3R no, that's not right
  • [7] IWYLK45K clicking to the right of a line within line width
  • [8] 4VKEE43Z bugfix
  • [9] ORRSP7FV deduce test names on failures
  • [10] LF7BWEG4 group all editor globals
  • [11] GJLOKCYK bugfix: clicking past end of screen line
  • [12] KKMFQDR4 editing source code from within the app
  • [13] KMSL74GA support selections in the source editor
  • [14] 5L7K4GBD clicking to the right of a wrapped line
  • [15] UHB4GARJ left/right margin -> left/right coordinates
  • [16] ILOA5BYF separate data structure for each line's cache data
  • [17] J6WEC2D6 .
  • [18] 5FW7YOFT highlight selection while dragging
  • [19] WZFMGVDT switch to line index in a function
  • [20] M6TH7VSZ rip out notion of Line_width
  • [*] LXTTOB33 extract a couple of files
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text_tests.lua at line 488
    [3.1263][3.690:730](),[3.690][3.690:730]()
    -- cursor moves to end of screen line
    [3.1263]
    [3.3494]
    -- cursor moves to end of screen line (one more than final character shown)
  • replacement in text_tests.lua at line 490
    [3.3550][3.3550:3605]()
    check_eq(Editor_state.cursor1.pos, 12, 'cursor:pos')
    [3.3550]
    [3.879]
    check_eq(Editor_state.cursor1.pos, 13, 'cursor:pos')
  • replacement in text_tests.lua at line 509
    [3.1334][3.715:755](),[3.715][3.715:755]()
    -- cursor moves to end of screen line
    [3.1334]
    [3.3660]
    -- cursor moves to end of screen line (one more than final character shown)
  • replacement in text_tests.lua at line 511
    [3.3716][3.3716:3771]()
    check_eq(Editor_state.cursor1.pos, 12, 'cursor:pos')
    [3.3716]
    [3.982]
    check_eq(Editor_state.cursor1.pos, 13, 'cursor:pos')
  • replacement in text_tests.lua at line 579
    [3.301][3.803:843](),[3.1547][3.803:843](),[3.803][3.803:843](),[3.843][3.4362:4413]()
    -- cursor moves to end of screen line
    check_eq(Editor_state.cursor1.pos, 20, 'cursor')
    [3.1547]
    [3.2]
    -- cursor moves to end of screen line (one more than final character shown)
    check_eq(Editor_state.cursor1.pos, 21, 'cursor')
  • replacement in text.lua at line 739
    [3.1535][3.6144:6218]()
    return line_cache.screen_line_starting_pos[screen_line_index+1]-1
    [3.1535]
    [3.528]
    return line_cache.screen_line_starting_pos[screen_line_index+1]
  • replacement in source_text_tests.lua at line 488
    [3.22797][3.22797:22837]()
    -- cursor moves to end of screen line
    [3.22797]
    [3.26860]
    -- cursor moves to end of screen line (one more than final character shown)
  • replacement in source_text_tests.lua at line 490
    [3.26916][3.26916:26971]()
    check_eq(Editor_state.cursor1.pos, 12, 'cursor:pos')
    [3.26916]
    [3.23012]
    check_eq(Editor_state.cursor1.pos, 13, 'cursor:pos')
  • replacement in source_text_tests.lua at line 509
    [3.23901][3.23901:23941]()
    -- cursor moves to end of screen line
    [3.23901]
    [3.27026]
    -- cursor moves to end of screen line (one more than final character shown)
  • replacement in source_text_tests.lua at line 511
    [3.27082][3.27082:27137]()
    check_eq(Editor_state.cursor1.pos, 12, 'cursor:pos')
    [3.27082]
    [3.24194]
    check_eq(Editor_state.cursor1.pos, 13, 'cursor:pos')
  • replacement in source_text_tests.lua at line 579
    [3.27713][3.27713:27753](),[3.27753][3.27728:27779]()
    -- cursor moves to end of screen line
    check_eq(Editor_state.cursor1.pos, 20, 'cursor')
    [3.27713]
    [3.730]
    -- cursor moves to end of screen line (one more than final character shown)
    check_eq(Editor_state.cursor1.pos, 21, 'cursor')
  • replacement in source_text.lua at line 801
    [3.134915][2.4993:5067]()
    return line_cache.screen_line_starting_pos[screen_line_index+1]-1
    [3.134915]
    [3.134996]
    return line_cache.screen_line_starting_pos[screen_line_index+1]