yet another bugfix in selection management

[?]
Jul 7, 2022, 2:39 PM
AQQQNDTL52Q2VO3XLEGYKHTU2YSRAB4ACEGVPSWYD2Z6WA6Z2YPAC

Dependencies

  • [2] 5DOTWNVM right margin
  • [3] J5IEBT64 enforce press/release state only processed once
  • [4] H3ECRBXF bugfix: clicking on empty lines
  • [5] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [6] QZH3PQFU .
  • [7] LXTTOB33 extract a couple of files
  • [8] ZLJGZYQG select text with shift + mouseclick
  • [9] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [10] 2INHXC3K position cursor by clicking on text
  • [11] 2ENZW7TV select text using mouse drag
  • [12] DHI6IJCN selecting text and deleting selections
  • [13] RMKMPFT5 fix a corner case when selecting text
  • [14] CCYSVZA2 bugfix: BSOD in #4.
  • [15] 4VKEE43Z bugfix
  • [16] DRFE3B3Z mouse buttons are integers, not strings
  • [17] VG75U7IM bugfix: typing should delete highlighted text
  • [18] 5FW7YOFT highlight selection while dragging
  • [19] EMHRPJ3R no, that's not right
  • [20] 7EQLPB3O bugfix: don't delete selection when moving cursor
  • [21] IWYLK45K clicking to the right of a line within line width
  • [22] M6TH7VSZ rip out notion of Line_width
  • [23] FYS7TCDW bugfix
  • [*] 7NQCCB34 .
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in text_tests.lua at line 79
    [25.105]
    [4.2]
    check_nil(Selection1.line, 'F - test_click_with_mouse/selection is empty to avoid perturbing future edits')
  • edit in text_tests.lua at line 338
    [5.7][5.7:140](),[5.140][5.382:421](),[5.421][5.179:207](),[5.179][5.179:207](),[5.207][2.866:913](),[2.913][5.225:669](),[5.225][5.225:669](),[5.669][5.1122:1127](),[5.1122][5.1122:1127]()
    function test_edit_after_click_resets_selection()
    io.write('\ntest_edit_after_click_resets_selection')
    -- display a line of text
    App.screen.init{width=75, height=80}
    Lines = load_array{'abc'}
    Margin_right = 0; Margin_width = Margin_left
    Cursor1 = {line=1, pos=1}
    Screen_top1 = {line=1, pos=1}
    Screen_bottom1 = {}
    App.draw()
    -- click past the end of it and hit enter
    App.run_after_mouse_click(Margin_left+40,Margin_top+5, 1)
    check(Selection1.line, 'F - test_edit_after_click_resets_selection/baseline')
    App.run_after_keychord('return')
    -- selection is reset since shift key is not pressed
    check_nil(Selection1.line, 'F - test_edit_after_click_resets_selection')
    end
  • replacement in main.lua at line 344
    [5.156][5.1719:1811](),[5.492][5.1719:1811]()
    -- delicate dance between cursor, selection and old cursor
    -- manual tests:
    [5.156]
    [5.1811]
    -- delicate dance between cursor, selection and old cursor/selection
    -- scenarios:
  • edit in main.lua at line 399
    [5.2682]
    [3.215]
    if eq(Cursor1, Selection1) then
    Selection1 = {}
    end