There's still lots of issues. We need to go from disabling exceptions to disabling everything by default and enabling a few exceptions.
X25YKED2GFLM4K6U5LTFZCSHGLM2HRT7SO4RKSLP4ARCHKZIAJUQC
on.keychord_press = function(chord, key)
assert(#Editors > 0)
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C-=' then
initialize_editors(Editors[1].font_height+2, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C--' then
initialize_editors(Editors[1].font_height-2, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C-f' or chord == 'backspace' or chord == 'return' then
-- find in just the left-most pane for now
edit.keychord_press(Editors[1], chord, key)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end
{"on.keychord_press":73,"on.initialize":36,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"on":1,"fw_parent":72,"on.text_input":69,"on.mouse_release":59,"on.mouse_press":63,"Editors":6,"resync_editors":70,"initialize_editors":67,"fw_app":"broadsheet"}
on.keychord_press = function(chord, key)
assert(#Editors > 0)
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C-=' then
initialize_editors(Editors[1].font_height+2, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C--' then
initialize_editors(Editors[1].font_height-2, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C-f' or chord == 'backspace' then
-- find in just the left-most pane for now
edit.keychord_press(Editors[1], chord, key)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end
{"on.text_input":69,"on.mouse_release":59,"on":1,"resync_editors":70,"fw_parent":71,"on.keychord_press":72,"fw_app":"broadsheet","on.initialize":36,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"initialize_editors":67,"Editors":6,"on.mouse_press":63}
on.keychord_press = function(chord, key)
assert(#Editors > 0)
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C-=' then
initialize_editors(Editors[1].font_height+2, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C--' then
initialize_editors(Editors[1].font_height-2, Editors[1].filename, Editors[1].screen_top1)
elseif chord == 'C-f' then
-- find in just the left-most pane for now
edit.keychord_press(Editors[1], chord, key)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end
{"fw_app":"broadsheet","on.text_input":69,"on.initialize":36,"resync_editors":70,"on.draw":60,"on":1,"fw_parent":70,"Editors":6,"on.mouse_release":59,"on.mouse_press":63,"initialize_editors":67,"on.key_release":15,"on.keychord_press":71,"Cursor_editor":16}
resync_editors = function()
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
Editors[e].screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
edit.draw(Editors[e], Text_color) -- initialize screen_bottom1
end
end
{"fw_app":"broadsheet","on.text_input":69,"on.initialize":36,"resync_editors":70,"on.draw":60,"on":1,"fw_parent":69,"Editors":6,"on.mouse_release":59,"on.mouse_press":63,"initialize_editors":67,"on.key_release":15,"on.keychord_press":45,"Cursor_editor":16}
on.text_input = function(t)
if Editors[1].search_term then
edit.text_input(Editors[1], t)
resync_editors()
end
end
{"fw_app":"broadsheet","on.text_input":69,"on.initialize":36,"resync_editors":68,"on.draw":60,"on":1,"fw_parent":68,"Editors":6,"on.mouse_release":59,"on.mouse_press":63,"initialize_editors":67,"on.key_release":15,"on.keychord_press":45,"Cursor_editor":16}
resync_editors = function()
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
Editors[e].screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
edit.draw(Editors[i], Text_color) -- initialize screen_bottom1
end
end
{"fw_app":"broadsheet","on.text_input":66,"on.initialize":36,"resync_editors":68,"on.draw":60,"on":1,"fw_parent":67,"Editors":6,"on.mouse_release":59,"on.mouse_press":63,"initialize_editors":67,"on.key_release":15,"on.keychord_press":45,"Cursor_editor":16}
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_top = screen_top
resync_editors()
end
{"fw_app":"broadsheet","on.text_input":66,"on.initialize":36,"on.draw":60,"on":1,"fw_parent":66,"Editors":6,"on.mouse_release":59,"on.mouse_press":63,"initialize_editors":67,"on.key_release":15,"on.keychord_press":45,"Cursor_editor":16}
on.text_input = function(t)
if Editorext_input(Editors[1], t) then
resync_editors()
end
end
{"fw_app":"broadsheet","on.keychord_press":45,"initialize_editors":62,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"on.initialize":36,"Editors":6,"on.mouse_press":63,"on.text_input":66,"on.mouse_release":59,"fw_parent":64,"on":1}
on.text_input = function(t)
if Editorext_input(Editors[1], t)
resync_editors()
end
end
{"fw_app":"broadsheet","on.keychord_press":45,"initialize_editors":62,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"on.initialize":36,"Editors":6,"on.mouse_press":63,"on.text_input":65,"on.mouse_release":59,"fw_parent":64,"on":1}
on.text_input = function(t)
for _,editor in ipairs(Editors) do
edit.text_input(editor, t)
end
end
{"fw_app":"broadsheet","on":1,"on.keychord_press":45,"initialize_editors":62,"on.key_release":15,"on.draw":60,"Cursor_editor":16,"Editors":6,"on.text_input":64,"on.mouse_press":63,"on.mouse_release":59,"fw_parent":63,"on.initialize":36}