Also better error message when there's no filename on commandline.
YEICDDOOQCEO6IM6YDZOHNL7KPG6WR5OEDPFPKI2T6B7Y5WKHJXAC
on.load_settings = function(settings)
if settings == nil then return end
Font_height = settings.font_height
Filename = settings.filename
Screen_top = settings.screen_top
end
{"on.mouse_press":63,"on.mouse_release":59,"Filename":85,"Screen_top":87,"on.text_input":69,"initialize_editors":81,"on.draw":60,"resync_editors":70,"Editors":6,"on":1,"on.save_settings":88,"on.initialize":94,"Font_height":86,"on.keychord_press":74,"fw_app":"broadsheet","on.key_release":15,"on.load_settings":95,"Cursor_editor":16,"fw_parent":94}
on.initialize = function(arg)
if #arg == 0 or arg[1] == Filename then
if Filename == nil then error('provide a filename') end
initialize_editors(Font_height, Filename, Screen_top)
else
initialize_editors(Font_height, arg[1], {line=1, pos=1})
end
end
{"Editors":6,"on.text_input":69,"resync_editors":70,"on.keychord_press":74,"fw_parent":92,"Cursor_editor":16,"on.save_settings":88,"on.mouse_press":63,"Font_height":86,"on":1,"on.load_settings":92,"on.mouse_release":59,"on.initialize":94,"fw_app":"broadsheet","initialize_editors":81,"Filename":85,"on.draw":60,"on.key_release":15,"Screen_top":87}
on.initialize = function(arg)
if #arg == 0 or arg[1] == Filename then
if Filename == nil then error('provide a filename')
initialize_editors(Font_height, Filename, Screen_top)
else
initialize_editors(Font_height, arg[1], {line=1, pos=1})
end
end
{"Editors":6,"on.text_input":69,"resync_editors":70,"on.keychord_press":74,"on.key_release":15,"fw_app":"broadsheet","on.save_settings":88,"on.mouse_press":63,"Font_height":86,"on":1,"on.load_settings":92,"fw_parent":92,"on.mouse_release":59,"Cursor_editor":16,"initialize_editors":81,"Filename":85,"on.draw":60,"on.initialize":93,"Screen_top":87}
on.load_settings = function(settings)
if settings == nil then return end
Font_height = settings.font_height
Filename = settings.filename
Screen_top = settings.screen_top
end
{"Editors":6,"on.text_input":69,"resync_editors":70,"on.keychord_press":74,"on.key_release":15,"fw_app":"broadsheet","on.save_settings":88,"on.mouse_press":63,"Font_height":86,"on":1,"on.load_settings":92,"fw_parent":91,"on.mouse_release":59,"Cursor_editor":16,"initialize_editors":81,"Filename":85,"on.draw":60,"on.initialize":90,"Screen_top":87}
on.load_settings = function(settings)
print('load settings', settings.filename)
Font_height = settings.font_height
Filename = settings.filename
Screen_top = settings.screen_top
end
{"on.text_input":69,"resync_editors":70,"on":1,"fw_app":"broadsheet","on.key_release":15,"Cursor_editor":16,"on.save_settings":88,"on.mouse_press":63,"Font_height":86,"on.mouse_release":59,"on.load_settings":91,"on.initialize":90,"initialize_editors":81,"Filename":85,"on.draw":60,"on.keychord_press":74,"Screen_top":87,"Editors":6,"fw_parent":90}
on.initialize = function(arg)
print(#arg, Filename)
if #arg == 0 or arg[1] == Filename then
initialize_editors(Font_height, Filename, Screen_top)
else
print('new file; reset cursor')
initialize_editors(Font_height, arg[1], {line=1, pos=1})
end
end
{"on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.mouse_press":63,"Filename":85,"on.mouse_release":59,"Screen_top":87,"fw_parent":89,"fw_app":"broadsheet","initialize_editors":81,"resync_editors":70,"on.draw":60,"Editors":6,"on.save_settings":88,"on":1,"Font_height":86,"on.initialize":90,"on.text_input":69,"on.load_settings":79}
on.initialize = function(arg)
if #arg == 0 or arg[1] == Filename then
initialize_editors(Font_height, Filename, Screen_top)
else
initialize_editors(Font_height, arg[1], {line=1, pos=1})
end
end
{"on.draw":60,"Editors":6,"on.text_input":69,"Filename":85,"fw_parent":88,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":88,"on.mouse_press":63,"Font_height":86,"on.mouse_release":59,"on.load_settings":79,"Screen_top":87,"initialize_editors":81,"on.initialize":89,"on":1}
on.save_settings = function()
return {
font_height = Editors[1].font_height,
filename = Editors[1].filename,
screen_top = Editors[1].screen_top1,
}
end
{"on.draw":60,"Editors":6,"on.text_input":69,"Filename":85,"fw_parent":87,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":88,"on.mouse_press":63,"Font_height":86,"on.mouse_release":59,"on.load_settings":79,"Screen_top":87,"initialize_editors":81,"on.initialize":82,"on":1}
{"on.draw":60,"Editors":6,"on.text_input":69,"Filename":85,"fw_parent":86,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":83,"on.mouse_press":63,"Font_height":86,"on.mouse_release":59,"on.load_settings":79,"Screen_top":87,"initialize_editors":81,"on.initialize":82,"on":1}
Screen_top = {line=1, pos=1} -- just during initial startup
{"on.draw":60,"Editors":6,"on.text_input":69,"Filename":85,"fw_parent":85,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":83,"on.mouse_press":63,"Font_height":86,"on.mouse_release":59,"on.load_settings":79,"initialize_editors":81,"on.initialize":82,"on":1}
Font_height = 20 -- just during initial startup
{"on.draw":60,"Editors":6,"on.text_input":69,"Filename":85,"fw_parent":84,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":83,"on.mouse_press":63,"Font_height":84,"on.mouse_release":59,"on.load_settings":79,"initialize_editors":81,"on.initialize":82,"on":1}
Filename = nil -- just during initial startup
{"on.draw":60,"Editors":6,"on.text_input":69,"fw_parent":83,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":83,"on.mouse_press":63,"Font_height":84,"on.mouse_release":59,"on.load_settings":79,"initialize_editors":81,"on.initialize":82,"on":1}
Font_height = 20 -- just for initial load
on.save_settings = function()
return {
font_height = Editors[1].font_height,
screen_top = Editors[1].screen_top1,
filename = Editors[1].filename,
}
end
{"on.draw":60,"Editors":6,"on.text_input":69,"fw_parent":82,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":83,"on.mouse_press":63,"Font_height":76,"on.mouse_release":59,"on.load_settings":79,"initialize_editors":81,"on.initialize":82,"on":1}