Merge lines.love

[?]
Nov 19, 2022, 8:28 AM
SCOXD4EOOL76VOGQSSNYDQS4IPXJTQ7FABDLG66GLLNREYRZF5CQC

Dependencies

  • [2] VP5KC4XZ Merge lines.love
  • [3] BH7BT36L ctrl+a: select entire buffer
  • [4] FS2ITYYH record a known issue
  • [5] 4YDBYBA4 clean up memory leak experiments
  • [6] ETXNVRPT Merge lines.love
  • [7] VO2ZVTWK Merge lines.love
  • [8] 73OCE2MC after much struggle, a brute-force undo
  • [9] KKMFQDR4 editing source code from within the app
  • [10] RSZD5A7G forgot to add json.lua
  • [11] 2L5MEZV3 experiment: new edit namespace
  • [12] MD3W5IRA new fork: rip out drawing support
  • [13] GUOQRUL7 Merge lines.love
  • [14] T4FRZSYL delete an ancient, unused file
  • [15] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [16] 3QNOKBFM beginnings of a test harness
  • [17] 32V6ZHQB Merge lines.love
  • [18] AVTNUQYR basic test-enabled framework
  • [19] VXORMHME delete experimental REPL
  • [20] VHQCNMAR several more modules
  • [21] KMSL74GA support selections in the source editor
  • [22] K2X6G75Z start writing some tests for drawings
  • [23] BLWAYPKV extract a module
  • [24] CE4LZV4T drop last couple of manual tests
  • [25] 3PSFWAIL Merge lines.love
  • [26] VHUNJHXB Merge lines.love
  • [27] XX7G2FFJ intermingle freehand line drawings with text
  • [28] 2CTN2IEF Merge lines.love
  • [29] OTIBCAUJ love2d scaffold
  • [30] 6LJZN727 handle chords
  • [31] BULPIBEG beginnings of a module for the text editor
  • [32] OGUV4HSA remove some memory leaks from rendered fragments
  • [33] OI4FPFIN support drawings in the source editor
  • [34] TLOAPLBJ add a license
  • [35] LXTTOB33 extract a couple of files
  • [36] D4B52CQ2 Merge lines.love
  • [37] D2GCFTTT clean up repl functionality
  • [38] RPGTBMMM Merge lines.love
  • [39] TVCPXAAU rename
  • [40] R5QXEHUI somebody stop me
  • [41] JOPVPUSA editing source code from within the app
  • [42] VBU5YHLR Merge lines.love
  • [43] 66X36NZN a little more prose describing manual_tests
  • [44] ATQO62TF Merge lines.love

Change contents

  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [4.2][4.165725:165764](),[4.2][4.165725:165764](),[4.165764][4.152440:152440]()
    elseif chord == 'C-a' then
    State.selection1 = {line=1, pos=1}
    State.cursor1 = {line=#State.lines, pos=utf8.len(State.lines[#State.lines].data)+1, posB=nil}
    elseif chord == 'C-c' then
    local s = Text.selection(State)
    if s then
    App.setClipboardText(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
    App.setClipboardText(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)
    local clipboard_data = App.getClipboardText()
    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)})
    chord ~= 'C-a' and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
    Text.delete_selection(State, State.left, State.right)
    end
  • replacement in source_edit.lua at line 314
    [4.25659][4.25659:25793]()
    chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
    [4.25659]
    [4.25793]
    chord ~= 'C-a' and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
  • edit in source_edit.lua at line 420
    [4.161892]
    [4.161892]
    elseif chord == 'C-a' then
    State.selection1 = {line=1, pos=1}
    State.cursor1 = {line=#State.lines, pos=utf8.len(State.lines[#State.lines].data)+1, posB=nil}