Merge lines.love

[?]
Sep 3, 2022, 10:27 PM
57OGXVHZ44WNWVKNCMPJT7SAOF4MR4GXJ4ZQKHUFAKLZBB6ERDLAC

Dependencies

  • [2] VEGH5443 Merge upstream into main
  • [3] NYMFNQDT Merge upstream into main
  • [4] EUBREN3I Merge upstream into main
  • [5] KKMFQDR4 editing source code from within the app
  • [6] YGCT2D2O start loading settings as applicable
  • [7] 3WNNXA6U bugfix: get tests to pass
  • [8] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [9] 2L5MEZV3 experiment: new edit namespace
  • [10] 5MR22SGZ bugfix: enable resize when loading settings
  • [11] VSBSWTE4 bugfix: where cursor is drawn
  • [12] 66X36NZN a little more prose describing manual_tests
  • [13] LF7BWEG4 group all editor globals
  • [14] OAHNWDYG .
  • [15] HPVT467W initialize contains test state
  • [16] G3VLJLDH use the background color
  • [17] M6JI7UJ7 obsolete comment
  • [18] LNUHQOGH start passing in Editor_state explicitly
  • [19] XX7G2FFJ intermingle freehand line drawings with text
  • [20] R6GUSTBY default font size and line-height
  • [21] NEXUNNCF extract a function
  • [22] MHOUX5JF experiment: turn off JIT
  • [23] TXDMRA5J bugfix: alt-tab shouldn't emit keypress events
  • [24] RT6EV6OP delegate update events to drawings
  • [25] KVHUFUFV reorg
  • [26] UHB4GARJ left/right margin -> left/right coordinates
  • [27] Z4KNS42N to open a file without a terminal, drag it on!
  • [28] UVIDOW6Z Merge upstream into main
  • [29] ZLEPKWDJ fork: capture frontend for a note-taking system
  • [30] OTIBCAUJ love2d scaffold
  • [31] JIK7ZRYI bugfix: imprecision in drawing
  • [32] AVTNUQYR basic test-enabled framework
  • [33] 4VKEE43Z bugfix
  • [34] OOL2X3B7 Merge upstream into main
  • [35] CV6XLZMW trailing slash on directory
  • [36] XNHZZH6B update /recent file with new filenames
  • [37] CNCYMM6A make test initializations a little more obvious
  • [38] K464QQR4 more defensive resize handling
  • [39] ELIVOJ4N bugfix: zoom in/out hotkeys
  • [40] PX7DDEMO autosave slightly less aggressively
  • [41] VO3GEIRW use app name in window title
  • [42] WQOSZSUE warn on unused commandline args
  • [43] S7ZZA3YE ugh, handle absolute as well as relative paths
  • [44] 3QQZ7W4E bring couple more globals back to the app level
  • [45] XSLCFVFH .
  • [46] JRLBUB6L more intuitive point delete from polygons
  • [47] SPNMXTYR have file API operate on state object
  • [48] HRWN5V6J Devine's suggestion to try to live with just freehand
  • [49] AJB4LFRB try to maintain a reasonable line width
  • [50] MSDHRXWU Merge upstream into main
  • [51] JCSLDGAH beginnings of support for multiple shapes
  • [52] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [53] 5XQ4Y7NU reorg manual tests doc
  • [54] 7M7LS7I2 start saving some settings to disk on quit
  • [55] AVQ5MC5D finish uppercasing all globals
  • [*] 2Y7YH7UP infrastructure for caching LÖVE text objects

Change contents

  • replacement in run.lua at line 29
    [5.178636][5.178636:179196]()
    if #arg > 0 then
    Editor_state.filename = arg[1]
    load_from_disk(Editor_state)
    Text.redraw_all(Editor_state)
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.cursor1 = {line=1, pos=1}
    edit.fixup_cursor(Editor_state)
    else
    load_from_disk(Editor_state)
    Text.redraw_all(Editor_state)
    if Editor_state.cursor1.line > #Editor_state.lines or Editor_state.lines[Editor_state.cursor1.line].mode ~= 'text' then
    edit.fixup_cursor(Editor_state)
    end
    end
    love.window.setTitle('lines.love - '..Editor_state.filename)
    [5.178636]
    [5.179196]
    assert(#arg == 0)
    Editor_state.file_path = os.date('%Y/%m/%d/%H-%M-%S')
    Editor_state.filename = Editor_state.directory..Editor_state.file_path
    Text.redraw_all(Editor_state)
    os.execute('mkdir -p '..dirname(Editor_state.filename))
    assert(not file_exists(Editor_state.filename))
  • replacement in run.lua at line 36
    [5.179197][5.179197:179276]()
    if #arg > 1 then
    print('ignoring commandline args after '..arg[1])
    end
    [5.179197]
    [5.179276]
    love.window.setTitle('capture.love - '..Editor_state.filename)
  • edit in run.lua at line 56
    [5.180163][5.180163:180297]()
    Editor_state.filename = Settings.filename
    Editor_state.screen_top1 = Settings.screen_top
    Editor_state.cursor1 = Settings.cursor
  • edit in run.lua at line 93
    [5.181820][5.181820:182297]()
    function run.filedropped(file)
    -- first make sure to save edits on any existing file
    if Editor_state.next_save then
    save_to_disk(Editor_state)
    end
    -- clear the slate for the new file
    App.initialize_globals()
    Editor_state.filename = file:getFilename()
    file:open('r')
    Editor_state.lines = load_from_file(file)
    file:close()
    Text.redraw_all(Editor_state)
    edit.fixup_cursor(Editor_state)
    love.window.setTitle('lines.love - '..Editor_state.filename)
    end
  • edit in run.lua at line 108
    [5.182570][5.182570:182756]()
    local filename = Editor_state.filename
    if filename:sub(1,1) ~= '/' then
    filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
    end
  • edit in run.lua at line 112
    [5.182904][5.182904:182996]()
    filename=filename,
    screen_top=Editor_state.screen_top1, cursor=Editor_state.cursor1
  • replacement in main.lua at line 34
    [6.127][6.148:168](),[6.168][6.8:137](),[6.87][6.8:40](),[6.137][6.8:40](),[6.90][6.8:40](),[6.40][6.90:197](),[6.90][6.90:197]()
    assert(#arg == 0)
    Editor_state.file_path = os.date('%Y/%m/%d/%H-%M-%S')
    Editor_state.filename = Editor_state.directory..Editor_state.file_path
    Text.redraw_all(Editor_state)
    os.execute('mkdir -p '..dirname(Editor_state.filename))
    assert(not file_exists(Editor_state.filename))
    [6.127]
    [3.9]
    if Current_app == nil then
    Current_app = 'run'
    end
  • edit in main.lua at line 38
    [6.9][6.198:263]()
    love.window.setTitle('capture.love - '..Editor_state.filename)
  • resurrect zombie in main.lua at line 38
    [6.9][5.185083:186724](),[6.9][5.185083:186724](),[6.88][5.186725:186729](),[6.88][5.186725:186729]()
    if Current_app == 'run' then
    load_file_from_source_or_save_directory('file.lua')
    load_file_from_source_or_save_directory('run.lua')
    load_file_from_source_or_save_directory('edit.lua')
    load_file_from_source_or_save_directory('text.lua')
    load_file_from_source_or_save_directory('search.lua')
    load_file_from_source_or_save_directory('select.lua')
    load_file_from_source_or_save_directory('undo.lua')
    load_file_from_source_or_save_directory('icons.lua')
    load_file_from_source_or_save_directory('text_tests.lua')
    load_file_from_source_or_save_directory('run_tests.lua')
    load_file_from_source_or_save_directory('drawing.lua')
    load_file_from_source_or_save_directory('geom.lua')
    load_file_from_source_or_save_directory('help.lua')
    load_file_from_source_or_save_directory('drawing_tests.lua')
    else
    load_file_from_source_or_save_directory('source_file.lua')
    load_file_from_source_or_save_directory('source.lua')
    load_file_from_source_or_save_directory('commands.lua')
    load_file_from_source_or_save_directory('source_edit.lua')
    load_file_from_source_or_save_directory('log_browser.lua')
    load_file_from_source_or_save_directory('source_text.lua')
    load_file_from_source_or_save_directory('search.lua')
    load_file_from_source_or_save_directory('select.lua')
    load_file_from_source_or_save_directory('source_undo.lua')
    load_file_from_source_or_save_directory('colorize.lua')
    load_file_from_source_or_save_directory('source_text_tests.lua')
    load_file_from_source_or_save_directory('source_tests.lua')
    end
  • edit in main.lua at line 66
    [5.186724]
    [5.186725]
    end
  • edit in main.lua at line 78
    [6.517][6.4934:5089](),[6.517][6.4934:5089]()
    Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, settings.font_height, math.floor(settings.font_height*1.3))
  • replacement in main.lua at line 91
    [5.187329][5.187329:187381]()
    love.window.setTitle('text.love - '..Current_app)
    [5.187329]
    [6.1139]
    love.window.setTitle('capture.love - '..Current_app)
  • replacement in main.lua at line 113
    [5.187950][5.187950:188002]()
    love.window.setTitle('text.love - '..Current_app)
    [5.187950]
    [6.440]
    love.window.setTitle('capture.love - '..Current_app)
  • edit in main.lua at line 116
    [6.7]
    [6.1353]
    function App.focus(in_focus)
    if in_focus then
    Last_focus_time = App.getTime()
    end
    if Current_app == 'run' then
    if run.focus then run.focus(in_focus) end
    elseif Current_app == 'source' then
    if source.focus then source.focus(in_focus) end
    else
    assert(false, 'unknown app "'..Current_app..'"')
    end
    end
  • edit in main.lua at line 154
    [6.86976][6.264:268](),[6.86976][6.264:268]()
    }
  • resurrect zombie in main.lua at line 154
    [6.8][5.188673:189596](),[6.8][5.188673:189596](),[6.181][5.189597:189872](),[6.181][5.189597:189872]()
    function App.keychord_pressed(chord, key)
    -- ignore events for some time after window in focus (mostly alt-tab)
    if App.getTime() < Last_focus_time + 0.01 then
    return
    end
    --
    if chord == 'C-e' then
    -- carefully save settings
    if Current_app == 'run' then
    local source_settings = Settings.source
    Settings = run.settings()
    Settings.source = source_settings
    if run.quit then run.quit() end
    Current_app = 'source'
    elseif Current_app == 'source' then
    Settings.source = source.settings()
    if source.quit then source.quit() end
    Current_app = 'run'
    else
    assert(false, 'unknown app "'..Current_app..'"')
    end
    Settings.current_app = Current_app
    love.filesystem.write('config', json.encode(Settings))
    -- reboot
    load_file_from_source_or_save_directory('main.lua')
    App.undo_initialize()
    App.run_tests_and_initialize()
    return
    if Current_app == 'run' then
    if run.keychord_pressed then run.keychord_pressed(chord, key) end
    elseif Current_app == 'source' then
    if source.keychord_pressed then source.keychord_pressed(chord, key) end
    else
    assert(false, 'unknown app "'..Current_app..'"')
  • edit in main.lua at line 182
    [5.189596]
    [5.189597]
    end
  • edit in main.lua at line 261
    [6.7][5.188003:188087](),[6.7][5.188003:188087](),[6.1119][5.188088:188321](),[6.1119][5.188088:188321](),[6.127][5.185029:185082](),[6.127][5.185029:185082]()
    function App.focus(in_focus)
    if in_focus then
    Last_focus_time = App.getTime()
    if Current_app == 'run' then
    if run.focus then run.focus(in_focus) end
    elseif Current_app == 'source' then
    if source.focus then source.focus(in_focus) end
    else
    assert(false, 'unknown app "'..Current_app..'"')
    end
    if Current_app == nil then
    Current_app = 'run'
  • resolve order conflict in main.lua at line 261
    [57.268]
  • edit in Manual_tests.md at line 25
    [4.85][6.338:385](),[6.1687][6.338:385]()
    * Logging files created in the 'recent' file.
  • edit in Manual_tests.md at line 27
    [5.211526]
    [5.211526]
    * Logging files created in the 'recent' file.