Merge lines.love

[?]
Sep 20, 2023, 9:32 PM
YXQOITYSGYQQBOMF7CJ33C2CTDAI5R2W2RCRSKJ6JTLV7MS4WVXAC

Dependencies

  • [2] R2ASHK5C fix a bad merge
  • [3] I4S4EFYX Merge lines.love
  • [4] 656FM555 bugfix: clear selection when clicking above or below lines
  • [5] T4FRZSYL delete an ancient, unused file
  • [6] BLWAYPKV extract a module
  • [7] KKMFQDR4 editing source code from within the app
  • [8] 2TQUKHBC Merge lines.love
  • [9] 2MGBV7NP bugfix: crash when using mouse wheel
  • [10] ED4Z6ORC cleaner API for file-system access
  • [11] VHUNJHXB Merge lines.love
  • [12] N2NUGNN4 include a brief reference enabling many useful apps
  • [13] GFXWHTE6 mouse wheel support
  • [14] G54H3YG2 get rid of all bifold text
  • [15] 66X36NZN a little more prose describing manual_tests
  • [16] TLOAPLBJ add a license
  • [17] RSZD5A7G forgot to add json.lua
  • [18] ZLJYLPOT Merge lines.love
  • [19] VP5KC4XZ Merge lines.love
  • [20] 3QNOKBFM beginnings of a test harness
  • [21] 5SM6DRHK port inscript's bugfix to source editor
  • [22] RU4HIK43 Merge lines.love
  • [23] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [24] OTIBCAUJ love2d scaffold
  • [25] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [26] A4BSGS2C Merge lines.love
  • [27] FS2ITYYH record a known issue
  • [28] 2CTN2IEF Merge lines.love
  • [29] ORRSP7FV deduce test names on failures
  • [30] 7FPELAZB ah, I see the problem
  • [31] KOTNETIM repeat changes on source editor
  • [32] 3PSFWAIL Merge lines.love
  • [33] D4B52CQ2 Merge lines.love
  • [34] LF7BWEG4 group all editor globals
  • [35] K2X6G75Z start writing some tests for drawings
  • [36] QJISOCHJ some temporary logging to catch a bug
  • [37] VXORMHME delete experimental REPL
  • [38] JOPVPUSA editing source code from within the app
  • [39] CE4LZV4T drop last couple of manual tests
  • [40] 2L5MEZV3 experiment: new edit namespace
  • [41] 73OCE2MC after much struggle, a brute-force undo
  • [42] BULPIBEG beginnings of a module for the text editor
  • [43] D2GCFTTT clean up repl functionality
  • [44] KMSL74GA support selections in the source editor
  • [45] K74U4BAU Merge lines.love
  • [46] 3XNFQDDN Merge lines.love
  • [47] AVTNUQYR basic test-enabled framework
  • [48] OGUV4HSA remove some memory leaks from rendered fragments
  • [49] ONHKBLLC Merge lines.love
  • [50] 34BZ5ZKN Merge lines.love
  • [51] 6LJZN727 handle chords
  • [52] VHQCNMAR several more modules
  • [53] LNUHQOGH start passing in Editor_state explicitly
  • [54] ORKN6EOB Merge lines.love
  • [55] R5QXEHUI somebody stop me
  • [56] LWPFEZBI Merge lines.love
  • [57] VOU73AK6 Merge lines.love
  • [58] MD3W5IRA new fork: rip out drawing support
  • [59] SGMA5JLE save the list of tests in repo
  • [60] B6DS4GZC Merge lines.love
  • [61] LXTTOB33 extract a couple of files
  • [62] 4YDBYBA4 clean up memory leak experiments
  • [63] WB6SIB7H Merge lines.love
  • [64] 6XCJX4DZ bugfix: inscript's bug
  • [65] XX7G2FFJ intermingle freehand line drawings with text
  • [66] 2344TV56 Merge lines.love
  • [67] TVCPXAAU rename

Change contents

  • file deletion: source_text_tests.lua (----------)source_text_tests.lua (----------)
    [5.2][5.83676:83721](),[5.2][5.83676:83721](),[5.83721][5.3498:3498]()
    -- selection remains empty
    check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
    end
    function test_draw_text()
    check_eq(Editor_state.cursor1.line, 1, 'cursor')
    -- selection remains empty
    check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
    end
    function test_click_below_all_lines()
    -- display one line
    App.screen.init{width=50, height=80}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    Editor_state.selection1 = {}
    -- click below first line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+50, 1)
    -- cursor doesn't move
    check_eq(Editor_state.cursor1.line, 1, 'cursor')
    Editor_state.selection1 = {}
    -- click on the empty line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    -- cursor moves
    Editor_state.selection1 = {}
    -- click on the other line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    -- cursor moves
    Editor_state.selection1 = {}
    -- click to the left of the line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left-4,Editor_state.top+5, 1)
    -- cursor moves to start of line
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [5.2][5.165725:165764](),[5.2][5.165725:165764](),[5.165764][5.152440:152440]()
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
    end
    function edit.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    end
    end
    function edit.clean_up_mouse_press(State)
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
    end
    -- still here? mouse release is below all screen lines
    State.cursor1.line, State.cursor1.pos = State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
    edit.clean_up_mouse_press(State)
    --? print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))
    edit.clean_up_mouse_press(State)
    return
    end
    end
    end
    if y < State.top then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    edit.clean_up_mouse_press(State)
    return
    end
    for line_index,line in ipairs(State.lines) do
    if line.mode == 'text' then
    if Text.in_line(State, line_index, x,y) then
    -- still here? mouse press is below all screen lines
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    State.selection1 = {
    line=State.screen_bottom1.line,
    pos=Text.pos_at_end_of_screen_line(State, State.screen_bottom1),
    }
  • edit in source_text_tests.lua at line 278
    [5.14387]
    [5.14387]
    Editor_state.selection1 = {}
  • edit in source_text_tests.lua at line 298
    [5.15292]
    [5.15292]
    Editor_state.selection1 = {}
  • edit in source_text_tests.lua at line 317
    [5.16102]
    [5.16102]
    Editor_state.selection1 = {}
  • edit in source_text_tests.lua at line 322
    [5.16261]
    [5.2285]
    check_eq(Editor_state.cursor1.line, 1, 'cursor')
    -- selection remains empty
    check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
    end
    function test_click_below_all_lines()
    -- display one line
    App.screen.init{width=50, height=80}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    Editor_state.selection1 = {}
    -- click below first line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+50, 1)
    -- cursor doesn't move
  • edit in source_text_tests.lua at line 342
    [5.2336]
    [5.16352]
    -- selection remains empty
    check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
  • replacement in source_edit.lua at line 298
    [5.4960][5.4960:5009]()
    -- still here? click is below all screen lines
    [5.4960]
    [5.5009]
    -- still here? mouse press is below all screen lines
  • edit in source_edit.lua at line 320
    [5.5440]
    [5.24407]
    if y < State.top then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    edit.clean_up_mouse_press(State)
    return
    end
  • replacement in source_edit.lua at line 335
    [5.5641][5.24808:25252](),[5.9366][5.24808:25252](),[5.24808][5.24808:25252]()
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
    end
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
    break
    [5.5641]
    [5.25252]
    edit.clean_up_mouse_press(State)
    return
  • edit in source_edit.lua at line 340
    [5.25282]
    [5.5642]
    -- still here? mouse release is below all screen lines
    State.cursor1.line, State.cursor1.pos = State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
    edit.clean_up_mouse_press(State)
  • edit in source_edit.lua at line 345
    [5.5837]
    [5.11]
    end
    end
    function edit.clean_up_mouse_press(State)
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
  • edit in source_edit.lua at line 356
    [5.17]
    [5.17]
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
  • replacement in edit.lua at line 195
    [2.3203][2.3203:3252]()
    -- still here? click is below all screen lines
    [2.3203]
    [2.3252]
    -- still here? mouse press is below all screen lines
  • edit in edit.lua at line 208
    [2.3727]
    [2.3727]
    if y < State.top then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    edit.clean_up_mouse_press(State)
    return
    end
  • replacement in edit.lua at line 221
    [2.4134][2.4134:4530]()
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
    end
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
    break
    [2.4134]
    [2.4530]
    edit.clean_up_mouse_press(State)
    return
  • edit in edit.lua at line 225
    [2.4544]
    [2.4544]
    -- still here? mouse release is below all screen lines
    State.cursor1.line, State.cursor1.pos = State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
    edit.clean_up_mouse_press(State)
  • edit in edit.lua at line 232
    [2.4742]
    [2.4742]
    function edit.clean_up_mouse_press(State)
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
    end
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
    end
  • edit in edit.lua at line 462
    [5.2969][4.3075:3135](),[5.2969][4.3075:3135](),[5.2969][4.3075:3135](),[5.1870][4.3603:3753](),[5.1870][4.3603:3753](),[5.3165][4.3365:3602](),[5.3165][4.3365:3602](),[5.3165][4.3365:3602](),[5.9624][4.3136:3364](),[5.9624][4.3136:3364](),[5.9624][4.3136:3364](),[5.2768][4.2908:3074](),[5.2768][4.2908:3074](),[5.2768][4.2908:3074](),[5.2288][4.2852:2907](),[5.2288][4.2852:2907]()
    edit.clean_up_mouse_press(State)
    return
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
    end
    end
    function edit.clean_up_mouse_press(State)
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
    -- still here? mouse release is below all screen lines
    State.cursor1.line, State.cursor1.pos = State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
    edit.clean_up_mouse_press(State)
    if y < State.top then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    edit.clean_up_mouse_press(State)
    return
    end
    -- still here? mouse press is below all screen lines
  • resolve order conflict in edit.lua at line 462
    [2.12430]