Merge lines.love

[?]
Mar 26, 2023, 4:57 PM
REAIVN7WJ3JMUKLX4BIACO2VMNHVTWLP3DMXPYD7PHVSYFFSV64QC

Dependencies

  • [2] ASP5RVZA Merge lines.love
  • [3] MU2HIRR6 Merge lines.love
  • [4] LIKTH6HM update stale source X-(
  • [5] A4BSGS2C Merge lines.love
  • [6] BLWAYPKV extract a module
  • [7] ORRSP7FV deduce test names on failures
  • [8] RSZD5A7G forgot to add json.lua
  • [9] ZTZOO2OQ Merge lines.love
  • [10] GUOQRUL7 Merge lines.love
  • [11] 2CK5QI7W make love event names consistent
  • [12] ORKN6EOB Merge lines.love
  • [13] XX7G2FFJ intermingle freehand line drawings with text
  • [14] KKMFQDR4 editing source code from within the app
  • [15] OTIBCAUJ love2d scaffold
  • [16] 73OCE2MC after much struggle, a brute-force undo
  • [17] VXORMHME delete experimental REPL
  • [18] VHQCNMAR several more modules
  • [19] 5Y24ZDZI bugfix
  • [20] BULPIBEG beginnings of a module for the text editor
  • [21] TLOAPLBJ add a license
  • [22] 2TQUKHBC Merge lines.love
  • [23] MD3W5IRA new fork: rip out drawing support
  • [24] ETXNVRPT Merge lines.love
  • [25] LXTTOB33 extract a couple of files
  • [26] CE4LZV4T drop last couple of manual tests
  • [27] VP5KC4XZ Merge lines.love
  • [28] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [29] LDFXFRUO bring a few things in sync between run and source
  • [30] T4FRZSYL delete an ancient, unused file
  • [31] 4U4VQWNY Merge lines.love
  • [32] MQTFTTEK Merge lines.love
  • [33] TVCPXAAU rename
  • [34] IX5YTLSV state validation in source editor as well
  • [35] 2CTN2IEF Merge lines.love
  • [36] G54H3YG2 get rid of all bifold text
  • [37] OGUV4HSA remove some memory leaks from rendered fragments
  • [38] 66X36NZN a little more prose describing manual_tests
  • [39] L6XA5EY2 test: moving a point
  • [40] KYNGDE2C consistent names in a few more places
  • [41] U3MJNFUY Merge lines.love
  • [42] AVTNUQYR basic test-enabled framework
  • [43] 2L5MEZV3 experiment: new edit namespace
  • [44] OI4FPFIN support drawings in the source editor
  • [45] 6LJZN727 handle chords
  • [46] JOPVPUSA editing source code from within the app
  • [47] K74U4BAU Merge lines.love
  • [48] FS2ITYYH record a known issue
  • [49] 4EGQRXDA bugfix: naming points
  • [50] K2X6G75Z start writing some tests for drawings
  • [51] KMSL74GA support selections in the source editor
  • [52] VHUNJHXB Merge lines.love
  • [53] R5QXEHUI somebody stop me
  • [54] 3QNOKBFM beginnings of a test harness
  • [55] VOU73AK6 Merge lines.love
  • [56] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [57] D2GCFTTT clean up repl functionality
  • [58] Q7XPSKII Merge lines.love
  • [59] 4YDBYBA4 clean up memory leak experiments
  • [60] 3PSFWAIL Merge lines.love

Change contents

  • file deletion: source_text.lua (----------)source_text.lua (----------)
    [5.2][5.147062:147101](),[5.2][5.147062:147101](),[5.147101][5.83723:83723]()
    assert(State.lines[State.cursor1.line].mode == 'text')
    local byte_offset = Text.offset(State.lines[State.cursor1.line].data, State.cursor1.pos)
    State.lines[State.cursor1.line].data = string.sub(State.lines[State.cursor1.line].data, 1, byte_offset-1)..t..string.sub(State.lines[State.cursor1.line].data, byte_offset)
    Text.clear_screen_line_cache(State, State.cursor1.line)
    State.cursor1.pos = State.cursor1.pos+1
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [5.2][5.165725:165764](),[5.2][5.165725:165764](),[5.165764][5.152440:152440]()
    if len > 0 then
    local byte_offset = Text.offset(p.name, len-1)
    if len == 1 then byte_offset = 0 end
    p.name = string.sub(p.name, 1, byte_offset)
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    end
    end
    end
    schedule_save(State)
    elseif State.lines.current_drawing and State.current_drawing_mode == 'name' then
    if chord == 'return' then
    State.current_drawing_mode = State.previous_drawing_mode
    State.previous_drawing_mode = nil
    else
    local before = snapshot(State, State.lines.current_drawing_index)
    local drawing = State.lines.current_drawing
    local p = drawing.points[drawing.pending.target_point]
    if chord == 'escape' then
    p.name = nil
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    elseif chord == 'backspace' then
    local len = utf8.len(p.name)
    elseif State.lines.current_drawing and State.current_drawing_mode == 'name' then
    local before = snapshot(State, State.lines.current_drawing_index)
    local drawing = State.lines.current_drawing
    local p = drawing.points[drawing.pending.target_point]
    p.name = p.name..t
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    --? print('text input', t)
    if State.search_term then
    State.search_term = State.search_term..t
    State.search_text = nil
    Text.search_next(State)
    --? print('release', State.cursor1.line)
    if State.lines.current_drawing then
    --? print('press', State.cursor1.line)
    if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
    -- press on a button and it returned 'true' to short-circuit
    return
    end
    for line_index,line in ipairs(State.lines) do
    button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0},
    icon = icon.insert_drawing,
    onpress1 = function()
    Drawing.before = snapshot(State, line_index-1, line_index)
    table.insert(State.lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
    table.insert(State.line_cache, line_index, {})
    if State.cursor1.line >= line_index then
    State.cursor1.line = State.cursor1.line+1
    end
    schedule_save(State)
    record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})
    end,
    })
    if loc1.line > #State.lines then return true end
    local l = State.lines[loc1.line]
    if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
    return loc1.pos > #State.lines[loc1.line].data
    end
    function edit.cursor_on_text(State)
    return State.cursor1.line <= #State.lines
    and State.lines[State.cursor1.line].mode == 'text'
    end
    function edit.put_cursor_on_first_text_line(State)
  • edit in source_text.lua at line 181
    [5.97898]
    [5.1487]
    assert(State.lines[State.cursor1.line].mode == 'text')
  • replacement in source_edit.lua at line 126
    [5.484][5.484:567]()
    return loc1.line > #State.lines
    or loc1.pos > #State.lines[loc1.line].data
    [5.484]
    [5.567]
    if loc1.line > #State.lines then return true end
    local l = State.lines[loc1.line]
    if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
    return loc1.pos > #State.lines[loc1.line].data
  • replacement in source_edit.lua at line 174
    [5.18866][5.18866:18934]()
    button(State, 'draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
    [5.18866]
    [5.18934]
    button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0},
  • replacement in source_edit.lua at line 230
    [5.157214][5.8888:8954]()
    --? print('press', State.selection1.line, State.selection1.pos)
    [5.157214]
    [5.157280]
    --? print('press', State.cursor1.line)
  • replacement in source_edit.lua at line 273
    [5.20874][5.20874:20897]()
    --? print('release')
    [5.20874]
    [5.20897]
    --? print('release', State.cursor1.line)
  • edit in source_edit.lua at line 325
    [5.5893]
    [5.157960]
    --? print('text input', t)
  • replacement in source_edit.lua at line 330
    [5.158089][5.21196:21247]()
    elseif State.current_drawing_mode == 'name' then
    [5.158089]
    [5.21247]
    elseif State.lines.current_drawing and State.current_drawing_mode == 'name' then
  • replacement in source_edit.lua at line 483
    [5.22390][5.22390:22441]()
    elseif State.current_drawing_mode == 'name' then
    [5.22390]
    [5.22441]
    elseif State.lines.current_drawing and State.current_drawing_mode == 'name' then
  • replacement in source_edit.lua at line 496
    [5.23003][5.23003:23263]()
    local byte_offset = Text.offset(p.name, len-1)
    if len == 1 then byte_offset = 0 end
    p.name = string.sub(p.name, 1, byte_offset)
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    [5.23003]
    [5.23263]
    if len > 0 then
    local byte_offset = Text.offset(p.name, len-1)
    if len == 1 then byte_offset = 0 end
    p.name = string.sub(p.name, 1, byte_offset)
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    end
  • resurrect zombie in drawing_tests.lua at line 493
    [3.1177][5.1724:1729](),[5.1724][5.1724:1729](),[5.1724][5.1724:1729]()
    end