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
love.window.setTitle('broadsheet.love - ' .. filename)
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