clicking to the right of a wrapped line

[?]
May 20, 2022, 5:26 AM
5L7K4GBDEAFH44LMLNKVFMHLWDNXXBKRPEI347VE5ZLXVFSMD2FAC

Dependencies

  • [2] 5Q6NIG66 bugfix
  • [3] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [4] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [5] BULPIBEG beginnings of a module for the text editor
  • [*] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [*] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [*] EX3GRC2K bugfix typo

Change contents

  • edit in text.lua at line 50
    [7.1901]
    [7.1901]
    line.screen_line_starting_pos = nil
  • edit in text.lua at line 283
    [3.519][3.519:555]()
    --? print('single screen line')
  • edit in text.lua at line 288
    [3.676][3.676:863]()
    --? print('move_cursor', mx, my)
    if my < line.y + math.floor(15*Zoom) then
    --? print('first screen line')
    Cursor_pos = Text.nearest_cursor_pos(line.data, mx)
    return
    end
  • replacement in text.lua at line 290
    [3.923][3.923:1056]()
    for _,screen_line_starting_pos in ipairs(line.screen_line_starting_pos) do
    --? print('screen line:', screen_line_starting_pos)
    [3.923]
    [3.1056]
    for screen_line_index,screen_line_starting_pos in ipairs(line.screen_line_starting_pos) do
  • edit in text.lua at line 293
    [3.1121]
    [3.1121]
    -- On all wrapped screen lines but the final one, clicks past end of
    -- line position cursor on final character of screen line.
    -- (The final screen line positions past end of screen line as always.)
    if mx > Line_width and screen_line_index < #line.screen_line_starting_pos then
    Cursor_pos = line.screen_line_starting_pos[screen_line_index+1] - 1
    return
    end
  • edit in manual_tests at line 6
    [2.237]
    [9.32]
    click to right of text -> cursor past end of line
    click to right of wrapped text -> cursor on final character of line