resolve conflicts

akkartik
Jul 10, 2024, 5:19 AM
RXMHAZ6VL4EJMYEZM32G4W54EPF3BPWPIGASJ7ND45FJ5F6TJCZAC

Dependencies

  • [2] TYLURRX3 resolve conflicts
  • [3] 4Z4XY6TK simplify some code now that lines contains no derived data
  • [4] 7ZXZGVHM purge obsolete term 'fragment'
  • [5] PTDO2SOT add state arg to schedule_save
  • [6] R5QXEHUI somebody stop me
  • [7] 3QNOKBFM beginnings of a test harness
  • [8] EB6LHFJR use deepcopy where possible
  • [9] CE4LZV4T drop last couple of manual tests
  • [10] MTJEVRJR add state arg to a few functions
  • [11] ISOFHXB2 App.width can no longer take a Text
  • [12] QCPXQ2E3 add state arg to a few functions
  • [13] YXQOITYS Merge lines.love
  • [14] 2TCIWW6Z stop caching starty
  • [15] 3XNFQDDN Merge lines.love
  • [16] GVJEOWYQ resolve conflicts
  • [17] BULPIBEG beginnings of a module for the text editor
  • [18] BH7BT36L ctrl+a: select entire buffer
  • [19] LK4ZW4BB bugfix
  • [20] 6LJZN727 handle chords
  • [21] BLWAYPKV extract a module
  • [22] 2TQUKHBC Merge lines.love
  • [23] RSZD5A7G forgot to add json.lua
  • [24] WPUHAZUC superfluous line
  • [25] ORKN6EOB Merge lines.love
  • [26] 7YGYHOEO Merge lines.love
  • [27] VHUNJHXB Merge lines.love
  • [28] TFUNIT6M resolve conflicts
  • [29] TOXPJJYY resolve conflicts
  • [30] CRBLAWBO resolve conflicts
  • [31] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [32] WKXJNESI resolve conflicts
  • [33] KKQKPGCI resolve conflicts
  • [34] 4J3Y3DJW pijul bug: redo upstream change
  • [35] VHQCNMAR several more modules
  • [36] SGMA5JLE save the list of tests in repo
  • [37] G54H3YG2 get rid of all bifold text
  • [38] LWPFEZBI Merge lines.love
  • [39] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [40] UN7GKYV5 support hyperlinks in the source editor
  • [41] OTIBCAUJ love2d scaffold
  • [42] LF7BWEG4 group all editor globals
  • [43] TGHAJBES use line cache for drawings as well
  • [44] N2NUGNN4 include a brief reference enabling many useful apps
  • [45] FS2ITYYH record a known issue
  • [46] MUDXM3JI clearing starty is redundant in mutations
  • [47] TBTRYEBP Merge lines.love
  • [48] QMRQL2FO resolve conflicts
  • [49] 6Z6WH62W resolve conflicts
  • [50] 66X36NZN a little more prose describing manual_tests
  • [51] TLOAPLBJ add a license
  • [52] TVCPXAAU rename
  • [53] MBAJPTDJ resolve conflicts
  • [54] D4B52CQ2 Merge lines.love
  • [55] LXTTOB33 extract a couple of files
  • [56] T4FRZSYL delete an ancient, unused file
  • [57] 73OCE2MC after much struggle, a brute-force undo
  • [58] VP5KC4XZ Merge lines.love
  • [59] VXORMHME delete experimental REPL
  • [60] JOPVPUSA editing source code from within the app
  • [61] SCOXD4EO Merge lines.love
  • [62] 6VJTQKW7 start supporting LÖVE v12
  • [63] VJ77YABH more efficient undo/redo
  • [64] MUJTM6RE bring back a level of wrapping
  • [65] XX7G2FFJ intermingle freehand line drawings with text
  • [66] 2CTN2IEF Merge lines.love
  • [67] 3PSFWAIL Merge lines.love
  • [68] G3DLS5OU audit all asserts
  • [69] 2L5MEZV3 experiment: new edit namespace
  • [70] OI4FPFIN support drawings in the source editor
  • [71] OGUV4HSA remove some memory leaks from rendered fragments
  • [72] R2ASHK5C fix a bad merge
  • [73] K2X6G75Z start writing some tests for drawings
  • [74] LNUHQOGH start passing in Editor_state explicitly
  • [75] KMSL74GA support selections in the source editor
  • [76] ED4Z6ORC cleaner API for file-system access
  • [77] ZS5IYZH5 stop caching screen_bottom1
  • [78] KKMFQDR4 editing source code from within the app
  • [79] WLWNS6FB a bug I've never run into
  • [80] AVTNUQYR basic test-enabled framework
  • [81] D2GCFTTT clean up repl functionality
  • [82] ILOA5BYF separate data structure for each line's cache data
  • [83] 4YDBYBA4 clean up memory leak experiments
  • [84] MOAEVTKJ clean up a few more loose ends
  • [85] ZLJYLPOT Merge lines.love
  • [86] IPMYE6WT establish a fairly fundamental invariant

Change contents

  • file deletion: source_undo.lua (----------)source_undo.lua (----------)
    [5.2][5.3457:3496](),[5.2][5.3457:3496](),[5.3496][5.5:5]()
    table.insert(event.lines, deepcopy(State.lines[i]))
    end
    return event
    end
    function patch(lines, from, to)
    --? if #from.lines == 1 and #to.lines == 1 then
    --? assert(from.start_line == from.end_line)
    --? assert(to.start_line == to.end_line)
    --? assert(from.start_line == to.start_line)
    --? lines[from.start_line] = to.lines[1]
    --? return
    --? end
  • file deletion: source_text.lua (----------)source_text.lua (----------)
    [5.2][5.147062:147101](),[5.2][5.147062:147101](),[5.147101][5.83723:83723]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    --? print('clearing line caches')
    -- Perform some early sanity checking here, in hopes that we correctly call
    -- this whenever we change editor state.
    if State.right <= State.left then
    assert(false, ('Right margin %d must be to the right of the left margin %d'):format(State.right, State.left))
    end
    end
    function Text.in_line(State, line_index, x,y)
    local line = State.lines[line_index]
    local line_cache = State.line_cache[line_index]
    end
    end
    end
    end
    end
    -- return the location of the start of the bottom-most line on screen
    function Text.screen_bottom1(State)
    -- duplicate some logic from love.draw
    -- does not modify State (except to populate line_cache)
    local loc2 = Text.to2(State, State.screen_top1)
    local y = State.top
    while true do
    if State.lines[loc2.line].mode == 'text' then
    y = y + State.line_height
    elseif State.lines[loc2.line].mode == 'drawing' then
    y = y + Drawing_padding_height + Drawing.pixels(State.lines[loc2.line].h, State.width)
    end
    if y + State.line_height > App.screen.height then break end
    local next_loc2 = Text.next_screen_line(State, loc2)
    if Text.eq2(next_loc2, loc2) then break end
    loc2 = next_loc2
    end
    return Text.to1(State, loc2)
    end
    end
    Text.clear_screen_line_cache(State, State.cursor1.line)
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [5.2][5.165725:165764](),[5.2][5.165725:165764](),[5.165764][5.152440:152440]()
    -- screen_line_starting_pos: optional array of codepoint indices if it wraps over more than one screen line
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    schedule_save(State)
    end
    -- clipboard
    schedule_save(State)
    end
    elseif chord == 'C-y' then
    elseif chord == 'return' then
    State.search_term = nil
    line_cache = {},
    -- Given wrapping, any potential location for the text cursor can be described in two ways:
    -- * schema 1: As a combination of line index and position within a line (in utf8 codepoint units)
    -- * schema 2: As a combination of line index, screen line index within the line, and a position within the screen line.
  • edit in undo.lua at line 59
    [5.269][5.1:33](),[5.33][5.2:2](),[5.2][5.3:102](),[5.102][5.2:2]()
    local line = State.lines[i]
    table.insert(event.lines, {data=line.data}) -- I've forgotten: should we deepcopy(line.data)?
  • edit in source_undo.lua at line 60
    [5.1968][5.1968:2030]()
    -- deep copy lines without cached stuff like text fragments
  • replacement in source_undo.lua at line 61
    [5.2045][5.2045:2077](),[5.2077][5.108:140](),[5.140][5.109:223](),[5.223][5.221:260](),[5.221][5.221:260](),[5.260][5.224:356](),[5.356][5.750:759](),[5.750][5.750:759](),[5.759][5.309:373](),[5.373][5.802:810](),[5.802][5.802:810]()
    local line = State.lines[i]
    if line.mode == 'text' then
    table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?
    elseif line.mode == 'drawing' then
    table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
    else
    assert(false, ('unknown line mode %s'):format(line.mode))
    end
    [5.2045]
    [5.2143]
    table.insert(event.lines, deepcopy(State.lines[i]))
  • edit in source_undo.lua at line 84
    [5.2725][5.2725:2775](),[5.2775][5.538:615](),[5.615][5.2818:2900](),[5.2818][5.2818:2900](),[5.2900][5.616:701](),[5.701][5.2951:3037](),[5.2951][5.2951:3037]()
    function patch_placeholders(line_cache, from, to)
    assert(from.start_line == to.start_line, 'failed to patch undo operation')
    for i=from.end_line,from.start_line,-1 do
    table.remove(line_cache, i)
    end
    assert(#to.lines == to.end_line-to.start_line+1, 'failed to patch undo operation')
    for i=1,#to.lines do
    table.insert(line_cache, to.start_line+i-1, {})
    end
    end
  • replacement in source_text.lua at line 292
    [5.2025][5.102754:102851](),[5.102754][5.102754:102851]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.2025]
    [5.102851]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_text.lua at line 430
    [5.2531][5.2531:2624]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.2531]
    [5.2624]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_text.lua at line 479
    [5.109040][5.109040:109133]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.108993]
    [5.4185]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_text.lua at line 541
    [5.4150][5.4150:4245]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.4150]
    [5.111378]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_text.lua at line 687
    [5.4881][5.4881:4976]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.4881]
    [5.123376]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_text.lua at line 832
    [5.5608][5.128639:128732](),[5.6538][5.128639:128732](),[5.128639][5.128639:128732]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.6538]
    [5.128745]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_text.lua at line 1121
    [5.146550][5.146550:146584]()
    --? print('clearing fragments')
    [5.146550]
    [5.201]
    --? print('clearing line caches')
  • replacement in source_edit.lua at line 56
    [5.153638][5.1398:1479](),[5.1479][5.153739:153852](),[5.153739][5.153739:153852]()
    -- fragments: snippets of the line guaranteed to not straddle screen lines
    -- screen_line_starting_pos: optional array of grapheme indices if it wraps over more than one screen line
    [5.153568]
    [5.153852]
    -- screen_line_starting_pos: optional array of codepoint indices if it wraps over more than one screen line
  • replacement in source_edit.lua at line 402
    [5.158465][5.158465:158562]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.158465]
    [5.158562]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • edit in source_edit.lua at line 444
    [5.161167][5.161167:161237]()
    patch_placeholders(State.line_cache, event.after, event.before)
  • replacement in source_edit.lua at line 446
    [5.21671][5.161237:161339](),[5.161237][5.161237:161339]()
    -- if we're scrolling, reclaim all fragments to avoid memory leaks
    Text.redraw_all(State)
    [5.21671]
    [5.161339]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in source_edit.lua at line 459
    [5.21761][5.161740:161842](),[5.161740][5.161740:161842]()
    -- if we're scrolling, reclaim all fragments to avoid memory leaks
    Text.redraw_all(State)
    [5.21761]
    [5.161842]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in edit.lua at line 277
    [5.6353][5.6353:6450]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [5.6353]
    [5.6450]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in edit.lua at line 322
    [5.7991][5.7991:8163]()
    patch_placeholders(State.line_cache, event.after, event.before)
    -- if we're scrolling, reclaim all fragments to avoid memory leaks
    Text.redraw_all(State)
    [5.7991]
    [5.8163]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • replacement in edit.lua at line 333
    [5.8613][5.8613:8715]()
    -- if we're scrolling, reclaim all fragments to avoid memory leaks
    Text.redraw_all(State)
    [5.8613]
    [5.8715]
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • edit in edit.lua at line 449
    [5.12430][2.1075:1075](),[5.296][4.1915:2014](),[5.296][4.1915:2014](),[5.296][4.1915:2014](),[5.104][4.1815:1914](),[5.104][4.1815:1914](),[5.104][4.1815:1914](),[5.7184][4.1715:1814](),[5.7184][4.1715:1814]()
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
    Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
  • resolve order conflict in edit.lua at line 449
    [5.12430]