Merge lines.love

[?]
Aug 31, 2023, 5:45 AM
HWTLXESCGV3A63XI62ZV4NXRE2AXTZS32P5QBWYGMSCTQDZTISPQC

Dependencies

  • [2] JDZVBFEI Merge lines.love
  • [3] ONHKBLLC Merge lines.love
  • [4] O5TGYJZQ bugfix in source editor
  • [5] OI4FPFIN support drawings in the source editor
  • [6] 3PSFWAIL Merge lines.love
  • [7] K74U4BAU Merge lines.love
  • [8] G54H3YG2 get rid of all bifold text
  • [9] 2TQUKHBC Merge lines.love
  • [10] SGMA5JLE save the list of tests in repo
  • [11] LWPFEZBI Merge lines.love
  • [12] 2L5MEZV3 experiment: new edit namespace
  • [13] MD3W5IRA new fork: rip out drawing support
  • [14] FS2ITYYH record a known issue
  • [15] 2344TV56 Merge lines.love
  • [16] ED4Z6ORC cleaner API for file-system access
  • [17] K2X6G75Z start writing some tests for drawings
  • [18] TVCPXAAU rename
  • [19] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [20] BLWAYPKV extract a module
  • [21] 3QNOKBFM beginnings of a test harness
  • [22] KMSL74GA support selections in the source editor
  • [23] LXTTOB33 extract a couple of files
  • [24] XX7G2FFJ intermingle freehand line drawings with text
  • [25] 2CTN2IEF Merge lines.love
  • [26] CE4LZV4T drop last couple of manual tests
  • [27] AVTNUQYR basic test-enabled framework
  • [28] ZLJYLPOT Merge lines.love
  • [29] KWHC65JI Merge lines.love
  • [30] FPY4LO2W make a few names consistent with snake_case
  • [31] BULPIBEG beginnings of a module for the text editor
  • [32] KKMFQDR4 editing source code from within the app
  • [33] R5QXEHUI somebody stop me
  • [34] JOPVPUSA editing source code from within the app
  • [35] T4FRZSYL delete an ancient, unused file
  • [36] ORKN6EOB Merge lines.love
  • [37] TLOAPLBJ add a license
  • [38] N2NUGNN4 include a brief reference enabling many useful apps
  • [39] OGUV4HSA remove some memory leaks from rendered fragments
  • [40] 66X36NZN a little more prose describing manual_tests
  • [41] B6DS4GZC Merge lines.love
  • [42] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [43] RU4HIK43 Merge lines.love
  • [44] RSZD5A7G forgot to add json.lua
  • [45] D2GCFTTT clean up repl functionality
  • [46] VXORMHME delete experimental REPL
  • [47] VHUNJHXB Merge lines.love
  • [48] 73OCE2MC after much struggle, a brute-force undo
  • [49] VP5KC4XZ Merge lines.love
  • [50] BH7BT36L ctrl+a: select entire buffer
  • [51] OTIBCAUJ love2d scaffold
  • [52] SCOXD4EO Merge lines.love
  • [53] VHQCNMAR several more modules
  • [54] 4YDBYBA4 clean up memory leak experiments
  • [55] 6LJZN727 handle chords

Change contents

  • file deletion: source_file.lua (----------)source_file.lua (----------)
    [5.2][5.152399:152438](),[5.2][5.152399:152438](),[5.152438][5.150241:150241]()
    local outfile = App.open_for_writing(App.save_dir..State.filename)
    if outfile == nil then
    error('failed to write to "'..State.filename..'"')
    end
    for _,line in ipairs(State.lines) do
    -- the source editor supports only files in the save dir backed by the source dir
    function load_from_disk(State)
    local infile = App.open_for_reading(App.save_dir..State.filename)
    if not infile then
    infile = App.open_for_reading(App.source_dir..State.filename)
    end
    State.lines = load_from_file(infile)
    if infile then infile:close() end
    end
    function load_from_file(infile)
    local result = {}
    if infile then
    local infile_next_line = infile:lines() -- works with both Lua files and LÖVE Files (https://www.love2d.org/wiki/File)
    while true do
    local line = infile_next_line()
    if line == nil then break end
    local infile = App.open_for_reading(App.save_dir..filename)
    if not infile then
    infile = App.open_for_reading(App.source_dir..filename)
    end
    if infile then
    infile:close()
    return true
    else
    return false
    end
    end
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [5.2][5.165725:165764](),[5.2][5.165725:165764](),[5.165764][5.152440:152440]()
    local clipboard_data = App.get_clipboard()
    for _,code in utf8.codes(clipboard_data) do
    local c = utf8.char(code)
    if c == '\n' then
    Text.insert_return(State)
    else
    Text.insert_at_cursor(State, c)
    end
    end
    if Text.cursor_out_of_screen(State) then
    Text.snap_cursor_to_bottom_of_screen(State, State.left, State.right)
    end
    schedule_save(State)
    record_undo_event(State, {before=before, after=snapshot(State, before_line, State.cursor1.line)})
    App.set_clipboard(s)
    end
    schedule_save(State)
    elseif chord == 'C-v' then
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
    -- We don't have a good sense of when to scroll, so we'll be conservative
    -- and sometimes scroll when we didn't quite need to.
    local before_line = State.cursor1.line
    local before = snapshot(State, before_line)
    App.set_clipboard(s)
    end
    elseif chord == 'C-x' then
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
    local s = Text.cut_selection(State, State.left, State.right)
    if s then
  • replacement in source_file.lua at line 4
    [5.150439][5.150439:150487]()
    local infile = App.open_for_reading(filename)
    [5.150439]
    [5.150487]
    local infile = App.open_for_reading(App.save_dir..filename)
    if not infile then
    infile = App.open_for_reading(App.source_dir..filename)
    end
  • edit in source_file.lua at line 16
    [5.150574]
    [5.150574]
    -- the source editor supports only files in the save dir backed by the source dir
  • replacement in source_file.lua at line 18
    [5.150605][5.150605:150659]()
    local infile = App.open_for_reading(State.filename)
    [5.150605]
    [5.150659]
    local infile = App.open_for_reading(App.save_dir..State.filename)
    if not infile then
    infile = App.open_for_reading(App.source_dir..State.filename)
    end
  • replacement in source_file.lua at line 47
    [5.151404][5.151404:151459]()
    local outfile = App.open_for_writing(State.filename)
    [5.151404]
    [5.151459]
    local outfile = App.open_for_writing(App.save_dir..State.filename)
  • replacement in source_edit.lua at line 451
    [5.161971][5.161971:162001]()
    App.setClipboardText(s)
    [5.161971]
    [5.162001]
    App.set_clipboard(s)
  • replacement in source_edit.lua at line 457
    [5.162224][5.162224:162254]()
    App.setClipboardText(s)
    [5.162224]
    [5.162254]
    App.set_clipboard(s)
  • replacement in source_edit.lua at line 466
    [5.162650][5.162650:162700]()
    local clipboard_data = App.getClipboardText()
    [5.162650]
    [5.162700]
    local clipboard_data = App.get_clipboard()