This was a pretty serious, almost-catastrophic[1] incident. I lost 160+ columns the first time I ran with a commandline arg (after a long time).
The root cause: I've been conflating globals Directory and Settings_file in my mind, and as a result I forgot about the existence of Settings_file altogether. Settings_file is the root variable. Everything else is dependent on it getting initialized right.
Process improvements:
[1] Not actually catastrophic because I didn't lose any actual notes.
WUJMPZPGPNVLBHEBVYTLSYWFOPEYVQJOPK45RFD576HTLG3NFCTAC
VJKBAJWASCQWI6JDVJJHL4WL2IDZF4RUT33GNILSRSPA3A6E2MBAC
DLFRVE5OBLCKIOBKNSCGF6AL6M35MZ24T2JE5UL66CLHCI6DN77QC
Q3HD3NQ6VOHEXHBSMQ5QDLKUH4OU2OJDMR3UXVOTB65IUUFJ2FCAC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
KE5FEMVJYSNYWUEDPM74EVUOFBHZDE3TGCVL6PXF2ALDZZ7XD2NQC
EMG7SDLWWVH66BJT6XUPLPVSICCM2BC5QD7LOTLLZCQ4XMFYRUDQC
CQYKYJJU3NMY2CNXF7VZWSDYU3SWPFWA3ZHDW24Q4S6QEK5Y2TSAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
J3ER7DFO2TXYUMJAXZUFEHQNLFDNIXSYDTE7HEFGQ2RYB3A6RFPAC
WLTFFU3YN5FKUMZEHLMTO4DJYJ6H73TVSTVUZRZBIZERXKZXCZCAC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
Cursor_pane.col = settings.cursor_col
Cursor_pane.row = settings.cursor_row
Display_settings.x = settings.surface_x
Display_settings.y = settings.surface_y
Cursor_pane.col = Settings.cursor_col
Cursor_pane.row = Settings.cursor_row
Display_settings.x = Settings.surface_x
Display_settings.y = Settings.surface_y
function App.load()
if love.filesystem.getInfo('config') then
Settings = json.decode(love.filesystem.read('config'))
Current_app = Settings.current_app
function App.load(arg)
-- the bootstrap for everything else
Settings_file = 'config'
assert(#arg <= 1)
if #arg == 1 then
Settings_file = 'config.'..arg[1]
end
if love.filesystem.getInfo(Settings_file) then
Settings = json.decode(love.filesystem.read(Settings_file))
else
Settings = {current_app='run'}