72MX5RH3KPJEGB73354XAFNP7L4B3N63II6BK3Z3SAAGWEIBIE2QC
on.initialize = function(arg)
initialize_editors(Font_height, --[[filename]] arg[1], Screen_top)
end
{"resync_editors":70,"on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":75,"on.mouse_press":63,"Font_height":76,"on.mouse_release":59,"on.load_settings":79,"on.initialize":82,"fw_parent":81,"fw_app":"broadsheet","Editors":6,"on.text_input":69,"on":1,"on.draw":60,"initialize_editors":81}
initialize_editors = function(font_height, filename, screen_top)
Editors = {}
love.graphics.setFont(love.graphics.newFont(font_height))
-- initialize multiple editor widgets
local emwidth = App.newText(love.graphics.getFont(), 'm'):getWidth()
local editor_width = 40*emwidth
local width_remaining = App.screen.width - Margin_left - Margin_right
local left = Margin_left
repeat
local editor = edit.initialize_state(Margin_top, left, left + math.min(editor_width, width_remaining), font_height, math.floor(font_height*1.3))
table.insert(Editors, editor)
width_remaining = width_remaining - editor_width - Margin_left
left = left + editor_width + Margin_left
until width_remaining < editor_width
-- have them all operate on the file's lines
Editors[1].filename = filename
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
Text.redraw_all(editor) -- TODO: share fragments between editors
end
Editors[1].screen_top1 = screen_top
resync_editors()
end
{"Cursor_editor":16,"on.save_settings":75,"on":1,"Font_height":76,"on.mouse_release":59,"on.load_settings":79,"on.initialize":80,"on.draw":60,"Editors":6,"on.text_input":69,"initialize_editors":81,"fw_parent":80,"resync_editors":70,"fw_app":"broadsheet","on.keychord_press":74,"on.mouse_press":63,"on.key_release":15}
on.initialize = function(arg)
print(Font_height, Screen_top.line, Screen_top.pos)
initialize_editors(Font_height, --[[filename]] arg[1], Screen_top)
end
{"Editors":6,"on.text_input":69,"on":1,"resync_editors":70,"on.keychord_press":74,"on.key_release":15,"Cursor_editor":16,"on.save_settings":75,"on.mouse_press":63,"Font_height":76,"on.mouse_release":59,"on.load_settings":79,"initialize_editors":67,"on.initialize":80,"fw_parent":79,"on.draw":60,"fw_app":"broadsheet"}
on.load_settings = function(settings)
Font_height = settings.font_height
Screen_top = settings.screen_top
end
{"on.mouse_release":59,"initialize_editors":67,"on.save_settings":75,"fw_parent":78,"Font_height":76,"on.text_input":69,"resync_editors":70,"on.load_settings":79,"on":1,"on.keychord_press":74,"on.initialize":78,"on.key_release":15,"Editors":6,"Cursor_editor":16,"on.draw":60,"on.mouse_press":63,"fw_app":"broadsheet"}
on.initialize = function(arg)
initialize_editors(Font_height, --[[filename]] arg[1], Screen_top)
end
{"on.text_input":69,"on.mouse_release":59,"Font_height":76,"on.save_settings":75,"fw_app":"broadsheet","resync_editors":70,"initialize_editors":67,"on":1,"on.keychord_press":74,"on.initialize":78,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"Editors":6,"on.mouse_press":63,"fw_parent":77}
on.initialize = function(arg)
initialize_editors(Font_height, --[[filename]] arg[1], --[[screen_top]] {line=1, pos=1})
end
{"on.text_input":69,"on.mouse_release":59,"Font_height":76,"on.save_settings":75,"fw_app":"broadsheet","resync_editors":70,"initialize_editors":67,"on":1,"on.keychord_press":74,"on.initialize":77,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"Editors":6,"on.mouse_press":63,"fw_parent":76}
{"on.text_input":69,"on.mouse_release":59,"Font_height":76,"on.save_settings":75,"fw_app":"broadsheet","resync_editors":70,"initialize_editors":67,"on":1,"on.keychord_press":74,"on.initialize":36,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"Editors":6,"on.mouse_press":63,"fw_parent":75}
Font_height = 20
on.save_settings = function()
return {
font_height = Editors[1].font_height,
screen_top = Editors[1].screen_top1,
}
end
{"on.text_input":69,"on.mouse_release":59,"on.save_settings":75,"fw_app":"broadsheet","resync_editors":70,"initialize_editors":67,"on":1,"on.keychord_press":74,"on.initialize":36,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"Editors":6,"on.mouse_press":63,"fw_parent":74}