start loading settings as applicable

[?]
Jul 1, 2022, 5:46 AM
YGCT2D2ORMLTBHANLGHZV3EBGGHD7ZK55UAM7HF2AVSHDXAAKK5QC

Dependencies

  • [2] M6TH7VSZ rip out notion of Line_width
  • [3] QGO66DNK initialize screen width to something reasonable
  • [4] AVQ5MC5D finish uppercasing all globals
  • [5] OYXDYPGS get rid of debug variables
  • [6] YKRF5V3Z starting to load/save
  • [7] QCQHLMST always have a filename
  • [8] XSLCFVFH .
  • [9] UWNHC4AA redo y computations
  • [10] OTIBCAUJ love2d scaffold
  • [11] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [12] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [13] AJB4LFRB try to maintain a reasonable line width
  • [14] 4VKEE43Z bugfix
  • [15] 3TTAYXPP cleanup
  • [16] VO3GEIRW use app name in window title
  • [17] Z4KNS42N to open a file without a terminal, drag it on!
  • [18] G3VLJLDH use the background color
  • [19] ZZ2B5RPQ extract variables for drawing padding
  • [20] PGZJ6NAT ensure Filename is writable when opened outside a terminal
  • [21] DLQMM265 scroll past first page
  • [22] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [23] YTSPVDZH first successful pagedown test, first bug found by test
  • [24] MHOUX5JF experiment: turn off JIT
  • [25] AVTNUQYR basic test-enabled framework
  • [26] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [27] PESSMQBJ no, make sure to compute line width after screen dimensions
  • [28] MGOQ5XAV start uppercasing globals
  • [29] 46ASCE5K first commandline arg: window dimensions
  • [30] B3IWYWSR delete another arg that can be deduced
  • [31] HOSPP2AN crisp font rendering
  • [32] RF5ALVNY allow the window to be resized
  • [33] WQOSZSUE warn on unused commandline args
  • [34] 73OCE2MC after much struggle, a brute-force undo
  • [35] M6JI7UJ7 obsolete comment
  • [36] YJGADSGK delete unused arg
  • [37] IZZVOCLB confirm that we have access to all of the love API
  • [38] AD34IX2Z couple more tests
  • [39] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [40] O6T3TPXD bugfix: position cursor up top when loading file
  • [41] R6GUSTBY default font size and line-height
  • [42] HFI2YR2C rip out geometry commandline arg
  • [43] W4UVZETR 2 regressions:
  • [44] NEXUNNCF extract a function
  • [*] K464QQR4 more defensive resize handling
  • [*] DHCLUDCW .

Change contents

  • replacement in main.lua at line 105
    [4.1738][3.8:39]()
    initialize_font_settings(20)
    [4.1738]
    [4.47]
    love.graphics.setBackgroundColor(1,1,1)
  • replacement in main.lua at line 107
    [4.48][3.40:71](),[3.71][4.8:51](),[4.39][4.8:51]()
    initialize_window_geometry()
    love.graphics.setBackgroundColor(1,1,1)
    [4.48]
    [4.126]
    if love.filesystem.getInfo('config') then
    load_settings()
    else
    load_defaults()
    end
  • replacement in main.lua at line 115
    [4.631][4.157:163](),[4.157][4.157:163](),[4.163][4.632:667](),[4.667][4.112:145](),[4.112][4.112:145](),[4.145][4.398:430](),[4.398][4.398:430](),[4.430][4.9199:9222](),[4.9222][4.3:15](),[4.690][4.3:15]()
    end
    Lines = load_from_disk(Filename)
    for i,line in ipairs(Lines) do
    if line.mode == 'text' then
    Cursor1.line = i
    break
    [4.631]
    [4.452]
    Lines = load_from_disk(Filename)
    Screen_top1 = {line=1, pos=1}
    Cursor1 = {line=1, pos=1}
    for i,line in ipairs(Lines) do
    if line.mode == 'text' then
    Cursor1.line = i
    break
    end
    end
    else
    Lines = load_from_disk(Filename)
    if Lines[Cursor1.line].mode ~= 'text' then
    for i,line in ipairs(Lines) do
    if line.mode == 'text' then
    Cursor1.line = i
    break
    end
    end
  • replacement in main.lua at line 145
    [4.73][4.40:63](),[4.88][4.40:63](),[4.2056][4.40:63](),[4.746][4.40:63]()
    end -- App.initialize
    [4.73]
    [4.1319]
    end
    function load_settings()
    local settings = json.decode(love.filesystem.read('config'))
    love.window.setPosition(settings.x, settings.y, settings.displayindex)
    App.screen.width, App.screen.height = settings.width, settings.height
    love.window.setMode(App.screen.width, App.screen.height)
    Filename = settings.filename
    initialize_font_settings(settings.font_height)
    Screen_top1 = settings.screen_top
    Cursor1 = settings.cursor
    end
    function load_defaults()
    initialize_font_settings(20)
    initialize_window_geometry()
    end
  • edit in main.lua at line 215
    [46.261]
    [47.5]
    --? print(Screen_top1.line, Screen_top1.pos, Cursor1.line, Cursor1.pos)
  • edit in main.lua at line 254
    [4.1510][4.127:153]()
    --? print('text')
  • edit in main.lua at line 259
    [4.2201]
    [2.1931]
    --? print('text.draw', y, line_index)