Merge lines.love

[?]
Mar 19, 2023, 6:59 AM
JKENJ2UGUCIHH27LSUZLVZIYOTUR3JDWUG453OFYTRL3V3IRQGTAC

Dependencies

  • [2] 2TQUKHBC Merge lines.love
  • [3] 5RDWSYK2 consistently use App names for methods everywhere
  • [4] 4J4TX7IS get typed in keystrokes to show on screen on iPad
  • [5] RSZD5A7G forgot to add json.lua
  • [6] R5QXEHUI somebody stop me
  • [7] UUTUPEOJ extract a function
  • [8] AOZX2G5F source: no commandline args
  • [9] LXTTOB33 extract a couple of files
  • [10] OGUV4HSA remove some memory leaks from rendered fragments
  • [11] CQYKYJJU remember window positions across restart/ctrl+e
  • [12] A4BSGS2C Merge lines.love
  • [13] T4FRZSYL delete an ancient, unused file
  • [14] K74U4BAU Merge lines.love
  • [15] 3PSFWAIL Merge lines.love
  • [16] EJOZAD7N typo
  • [17] FS2ITYYH record a known issue
  • [18] AVTNUQYR basic test-enabled framework
  • [19] XX7G2FFJ intermingle freehand line drawings with text
  • [20] 4YDBYBA4 clean up memory leak experiments
  • [21] KKMFQDR4 editing source code from within the app
  • [22] ETXNVRPT Merge lines.love
  • [23] VP5KC4XZ Merge lines.love
  • [24] ORKN6EOB Merge lines.love
  • [25] EMG7SDLW bugfix: cold start
  • [26] TVCPXAAU rename
  • [27] CE4LZV4T drop last couple of manual tests
  • [28] D2GCFTTT clean up repl functionality
  • [29] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [30] HCFDBUXH fix stale comment
  • [31] 6LJZN727 handle chords
  • [32] 3QNOKBFM beginnings of a test harness
  • [33] 2CK5QI7W make love event names consistent
  • [34] MD3W5IRA new fork: rip out drawing support
  • [35] JOPVPUSA editing source code from within the app
  • [36] 66X36NZN a little more prose describing manual_tests
  • [37] D76MS2G2 Merge lines.love
  • [38] VHQCNMAR several more modules
  • [39] OTIBCAUJ love2d scaffold
  • [40] VXORMHME delete experimental REPL
  • [41] K2X6G75Z start writing some tests for drawings
  • [42] DB7HJBHJ Merge lines.love
  • [43] ZTZOO2OQ Merge lines.love
  • [44] S3PNFXTB handle missing cursors in settings
  • [45] JMUD7T3O get rid of ugly side-effects in tests
  • [46] L2FWWEQL source: remember cursor position of multiple files
  • [47] ATQO62TF Merge lines.love
  • [48] BLWAYPKV extract a module
  • [49] 2L5MEZV3 experiment: new edit namespace
  • [50] A23MMLJH migrate old settings, attempt #3
  • [51] U3MJNFUY Merge lines.love
  • [52] VHUNJHXB Merge lines.love
  • [53] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [54] GUOQRUL7 Merge lines.love
  • [55] QS3YLNKZ Merge lines.love
  • [56] DCO5BQWV Merge lines.love
  • [57] AYX33NBC Merge lines.love
  • [58] 2CTN2IEF Merge lines.love
  • [59] BULPIBEG beginnings of a module for the text editor
  • [60] KMSL74GA support selections in the source editor
  • [61] SDO4DHNU source: load cursor position from settings
  • [62] 73OCE2MC after much struggle, a brute-force undo
  • [63] TLOAPLBJ add a license

Change contents

  • file deletion: source.lua (----------)source.lua (----------)
    [5.2][5.177652:177686](),[5.2][5.177652:177686](),[5.177686][5.165766:165766]()
    end
    function source.resize_window_from_settings(settings)
    -- maximize window to determine maximum allowable dimensions
    App.screen.resize(0, 0) -- maximize
    Display_width, Display_height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(Display_width, 200)
    App.screen.flags.minheight = math.min(Display_height, 200)
    App.screen.width, App.screen.height = settings.width, settings.height
    --? print('setting window from settings:', App.screen.width, App.screen.height)
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    end
    function source.set_window_position_from_settings(settings)
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
    -- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
    App.screen.move(settings.x, settings.y-37, settings.displayindex)
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
    -- maximize window
    end
    function source.initialize_default_settings()
    local font_height = 20
    love.graphics.setFont(love.graphics.newFont(font_height))
    local em = App.newText(love.graphics.getFont(), 'm')
    source.initialize_window_geometry(App.width(em))
    Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)
    source.resize_window_from_settings(settings)
    --? print('loading source position', settings.x, settings.y, settings.displayindex)
    source.set_window_position_from_settings(settings)
    Show_log_browser_side = settings.show_log_browser_side
    local right = App.screen.width - Margin_right
    if Show_log_browser_side then
    right = App.screen.width/2 - Margin_right
    end
    Editor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))
    Editor_state.filename = settings.filename
  • file deletion: run.lua (----------)run.lua (----------)
    [5.2][5.184046:184077](),[5.2][5.184046:184077](),[5.184077][5.178044:178044]()
    Settings.x, Settings.y, Settings.displayindex = App.screen.position()
    end
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    end
    function run.resize(w, h)
    --? print(("Window resized to width: %d and height: %d."):format(w, h))
    App.screen.width, App.screen.height = w, h
    Text.redraw_all(Editor_state)
    Editor_state.selection1 = {} -- no support for shift drag while we're resizing
    Editor_state.right = App.screen.width-Margin_right
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)
    end
    App.screen.resize(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    -- shrink height slightly to account for window decoration
    App.screen.height = App.screen.height-100
    App.screen.width = 40*em_width
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(App.screen.width, 200)
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    App.screen.move(Settings.x, Settings.y, Settings.displayindex)
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
    -- maximize window
    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
    function run.initialize_default_settings()
    local font_height = 20
    love.graphics.setFont(love.graphics.newFont(font_height))
    local em = App.newText(love.graphics.getFont(), 'm')
    run.initialize_window_geometry(App.width(em))
    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
    Settings = run.settings()
    end
    function run.initialize_window_geometry(em_width)
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
  • replacement in source.lua at line 108
    [5.168600][5.168600:168663](),[5.168663][5.4319:4428](),[5.4428][5.168778:169126](),[5.168778][5.168778:169126](),[5.169126][5.4429:4504]()
    -- maximize window to determine maximum allowable dimensions
    App.screen.resize(0, 0) -- maximize
    Display_width, Display_height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(Display_width, 200)
    App.screen.flags.minheight = math.min(Display_height, 200)
    App.screen.width, App.screen.height = settings.width, settings.height
    --? print('setting window from settings:', App.screen.width, App.screen.height)
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    [5.168600]
    [5.169203]
    source.resize_window_from_settings(settings)
  • edit in source.lua at line 127
    [5.2001]
    [5.2001]
    end
    end
    function source.resize_window_from_settings(settings)
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
  • edit in source.lua at line 138
    [5.2007]
    [5.169796]
    -- maximize window to determine maximum allowable dimensions
    App.screen.resize(0, 0) -- maximize
    Display_width, Display_height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(Display_width, 200)
    App.screen.flags.minheight = math.min(Display_height, 200)
    App.screen.width, App.screen.height = settings.width, settings.height
    --? print('setting window from settings:', App.screen.width, App.screen.height)
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
  • replacement in source.lua at line 151
    [5.169861][5.169861:170009]()
    -- setPosition doesn't quite seem to do what is asked of it on Linux.
    love.window.setPosition(settings.x, settings.y-37, settings.displayindex)
    [5.169861]
    [5.170009]
    -- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
    App.screen.move(settings.x, settings.y-37, settings.displayindex)
  • edit in source.lua at line 168
    [5.170525]
    [5.170525]
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
  • replacement in run.lua at line 51
    [5.60][5.179363:179443](),[5.179363][5.179363:179443]()
    App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
    [5.60]
    [5.179443]
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
  • replacement in run.lua at line 57
    [5.179787][5.179787:179864](),[5.179864][5.15:88]()
    love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
    love.window.setPosition(Settings.x, Settings.y, Settings.displayindex)
    [5.179787]
    [5.179864]
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    App.screen.move(Settings.x, Settings.y, Settings.displayindex)
  • edit in run.lua at line 78
    [5.180688]
    [5.180688]
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
  • replacement in run.lua at line 86
    [5.180709][5.180709:180830]()
    love.window.setMode(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
    [5.180709]
    [5.180830]
    App.screen.resize(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
  • replacement in run.lua at line 94
    [5.210][5.181129:181206](),[5.181129][5.181129:181206]()
    love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
    [5.210]
    [5.181206]
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
  • replacement in run.lua at line 141
    [5.120][5.120:198]()
    Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
    [5.120]
    [5.198]
    Settings.x, Settings.y, Settings.displayindex = App.screen.position()