bugfix: typing should delete highlighted text

[?]
Jun 20, 2022, 5:48 PM
VG75U7IM2ZQTGM2QETDT6QQ4CSLQPB4APK436POAAQJWOMINPIJAC

Dependencies

  • [2] FYS7TCDW bugfix
  • [3] BYG5CEMV support for naming points
  • [4] MP2TBKU6 bugfix: crash in Text.up() after return
  • [5] PX7DDEMO autosave slightly less aggressively
  • [6] JCSLDGAH beginnings of support for multiple shapes
  • [7] AVTNUQYR basic test-enabled framework
  • [8] 6E3HVYWF test and App helper for mouse clicks
  • [9] 65XHTZEK regression: couldn't do many drawing operations because line.y was reset
  • [10] XNFTJHC4 split keyboard handling between Text and Drawing
  • [11] TVM2WIHH bugfix: autosave and undo in a couple of cases
  • [12] HRWN5V6J Devine's suggestion to try to live with just freehand
  • [13] YTSPVDZH first successful pagedown test, first bug found by test
  • [*] LXTTOB33 extract a couple of files
  • [*] 4VKEE43Z bugfix
  • [*] OTIBCAUJ love2d scaffold
  • [*] JRLBUB6L more intuitive point delete from polygons
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • edit in text_tests.lua at line 207
    [16.1127]
    [15.2457]
    function test_edit_deletes_selection()
    io.write('\ntest_edit_deletes_selection')
    -- display a line of text with some part selected
    App.screen.init{width=80, height=80}
    Lines = load_array{'abc'}
    Line_width = 75
    Cursor1 = {line=1, pos=1}
    Selection1 = {line=1, pos=2}
    Screen_top1 = {line=1, pos=1}
    Screen_bottom1 = {}
    App.draw()
    -- press a key
    App.run_after_textinput('x')
    -- selected text is deleted and replaced with the key
    check_eq(Lines[1].data, 'xbc', 'F - test_edit_deletes_selection')
    end
  • edit in main.lua at line 410
    [3.649][2.810:867]()
    if not App.shift_down() then
    Selection1 = {}
    end
  • edit in main.lua at line 540
    [3.706]
    [3.706]
    record_undo_event({before=before, after=snapshot(Lines.current_drawing_index)})
  • edit in main.lua at line 545
    [3.889]
    [3.889]
    record_undo_event({before=before, after=snapshot(Lines.current_drawing_index)})
  • edit in main.lua at line 547
    [3.899][3.278:364]()
    record_undo_event({before=before, after=snapshot(Lines.current_drawing_index)})
  • edit in main.lua at line 552
    [3.5055][2.868:925]()
    end
    if not App.shift_down() then
    Selection1 = {}
  • edit in main.lua at line 556
    [3.1591]
    [18.327]
    if not App.shift_down() then
    Selection1 = {}
    end
  • edit in app.lua at line 235
    [3.6984]
    [3.6984]
    -- all textinput events are also keypresses
  • edit in app.lua at line 237
    [3.7020]
    [3.7020]
    App.keypressed(t)
  • edit in app.lua at line 239
    [3.7039]
    [3.2937]
    App.keyreleased(t)
  • replacement in app.lua at line 244
    [3.2982][3.2982:3047]()
    function App.run_after_keychord(key)
    App.keychord_pressed(key)
    [3.2982]
    [3.710]
    -- not all keys are textinput
    function App.run_after_keychord(chord)
    App.keychord_pressed(chord)
    App.keyreleased(chord)