yet another fork trying to integrate my live framework with everything else

[?]
Nov 27, 2022, 7:05 PM
YJ6ASFBGEATFRCO2OF2AA4EPOBLWXTIV6YZMHALW3QVR7XTOSJPAC

Dependencies

  • [2] RXNR3U5E Merge text.love
  • [3] JCXL74WV bring back everything from commit a68647ae22
  • [4] RF5ALVNY allow the window to be resized
  • [5] NEXUNNCF extract a function
  • [6] 46ASCE5K first commandline arg: window dimensions
  • [7] AVQ5MC5D finish uppercasing all globals
  • [8] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [9] UHB4GARJ left/right margin -> left/right coordinates
  • [10] KKMFQDR4 editing source code from within the app
  • [11] 2CTN2IEF Merge lines.love
  • [12] YGCT2D2O start loading settings as applicable
  • [13] VNJ2M364 bugfix: window title
  • [14] WQOSZSUE warn on unused commandline args
  • [15] AJB4LFRB try to maintain a reasonable line width
  • [16] JOPVPUSA editing source code from within the app
  • [17] X3CQLBTR set window title within each app
  • [18] AKZWDWIA Merge lines.love
  • [19] 36Z442IV back to commit 8123959e52f without code editing
  • [20] APX2PY6G stop tracking wallclock time
  • [21] DCO5BQWV Merge lines.love
  • [22] HFI2YR2C rip out geometry commandline arg
  • [23] CE4LZV4T drop last couple of manual tests
  • [24] Z4KNS42N to open a file without a terminal, drag it on!
  • [25] AVTNUQYR basic test-enabled framework
  • [26] XSLCFVFH .
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in main.lua at line 38
    [4.2502][4.2502:2567](),[4.2567][4.187263:187270](),[4.187263][4.187263:187270](),[4.187270][4.2568:2602](),[4.2602][4.187323:187329](),[4.187323][4.187323:187329]()
    if love.filesystem.getInfo('config') then
    load_settings()
    else
    initialize_default_settings()
    end
  • replacement in main.lua at line 39
    [4.1320][4.2603:2814](),[4.2814][4.187568:187575](),[4.187568][4.187568:187575](),[4.187575][4.2815:2882](),[4.2882][4.187628:187634](),[4.187628][4.187628:187634](),[4.187634][4.2883:2945]()
    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}
    else
    load_from_disk(Editor_state)
    Text.redraw_all(Editor_state)
    end
    love.window.setTitle('text.love - '..Editor_state.filename)
    [4.1320]
    [2.9]
    initialize_default_settings()
  • replacement in main.lua at line 41
    [4.41][4.2946:3019](),[4.3019][4.187401:187407](),[4.187401][4.187401:187407]()
    if #arg > 1 then
    print('ignoring commandline args after '..arg[1])
    end
    [4.41]
    [4.187463]
    -- TODO: app-specific stuff goes here
    love.window.setTitle('TODO')
  • edit in main.lua at line 50
    [4.3084][4.3084:3422](),[4.3495][4.3495:3805](),[4.3805][3.2557:2630](),[3.2630][4.3805:4099](),[4.3805][4.3805:4099]()
    function load_settings()
    local settings = json.decode(love.filesystem.read('config'))
    love.graphics.setFont(love.graphics.newFont(settings.font_height))
    -- maximize window to determine maximum allowable dimensions
    App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
    -- set up desired window dimensions
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(App.screen.width, 200)
    App.screen.flags.minheight = math.min(App.screen.width, 200)
    App.screen.width, App.screen.height = settings.width, settings.height
    love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
    love.window.setPosition(settings.x, settings.y, settings.displayindex)
    Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, settings.font_height, math.floor(settings.font_height*1.3))
    Editor_state.filename = settings.filename
    Editor_state.screen_top1 = settings.screen_top
    Editor_state.cursor1 = settings.cursor
    end
  • edit in main.lua at line 55
    [4.4322][4.4322:4538]()
    Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)
    Editor_state.font_height = font_height
    Editor_state.line_height = math.floor(font_height*1.3)
    Editor_state.em = em
  • replacement in main.lua at line 112
    [4.6189][4.6189:6317](),[4.6317][3.2631:2668](),[3.2668][4.6352:6770](),[4.6352][4.6352:6770]()
    -- save some important settings
    local x,y,displayindex = love.window.getPosition()
    local filename = Editor_state.filename
    if is_relative_path(filename) then
    filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
    end
    local settings = {
    x=x, y=y, displayindex=displayindex,
    width=App.screen.width, height=App.screen.height,
    font_height=Editor_state.font_height,
    filename=filename,
    screen_top=Editor_state.screen_top1, cursor=Editor_state.cursor1}
    love.filesystem.write('config', json.encode(settings))
    [4.6189]
    [4.6770]
    -- TODO: save settings