Merge template-live-editor

This commit is contained in:
Kartik K. Agaram 2023-04-16 11:23:26 -07:00
commit e489f9f6e6
226 changed files with 116 additions and 1497 deletions

1
0000-freewheeling-start Normal file
View File

@ -0,0 +1 @@
This file contains no definition, but is used as a marker in the save dir to indicate all definitions have been copied from the repo to the save dir.

View File

@ -1 +0,0 @@
{"fw_parent":0,"on":1}

View File

@ -1 +0,0 @@
{"fw_parent":1,"on.initialize":2,"fw_app":"broadsheet","on":1}

View File

@ -1,3 +0,0 @@
on.initialize = function(arg)
print(arg)
end

View File

@ -1 +0,0 @@
{"fw_parent":2,"on.initialize":2,"on.draw":3,"on":1,"fw_app":"broadsheet"}

View File

@ -1,2 +0,0 @@
on.draw = function()
end

View File

@ -1 +0,0 @@
{"fw_parent":3,"fw_app":"broadsheet","on.initialize":4,"on":1,"on.draw":3}

View File

@ -1,3 +0,0 @@
on.initialize = function(arg)
print(arg[1])
end

View File

@ -1 +0,0 @@
Editors = {}

View File

@ -1 +0,0 @@
{"fw_parent":4,"Editors":5,"fw_app":"broadsheet","on.initialize":4,"on.draw":3,"on":1}

View File

@ -1 +0,0 @@
{"fw_parent":5,"Editors":6,"fw_app":"broadsheet","on.initialize":4,"on.draw":3,"on":1}

View File

@ -1 +0,0 @@
{"fw_parent":6,"Editors":6,"fw_app":"broadsheet","on.initialize":7,"on.draw":3,"on":1}

View File

@ -1,13 +0,0 @@
on.initialize = function(arg)
local font_height = 20
love.graphics.setFont(love.graphics.newFont(font_height))
local emwidth = App.newText('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(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
until width_remaining < editor_width
end

View File

@ -1 +0,0 @@
{"fw_parent":6,"Editors":6,"fw_app":"broadsheet","on.initialize":8,"on.draw":3,"on":1}

View File

@ -1,13 +0,0 @@
on.initialize = function(arg)
local font_height = 20
love.graphics.setFont(love.graphics.newFont(font_height))
local emwidth = App.newText('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(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
until width_remaining < editor_width
end

View File

@ -1 +0,0 @@
{"fw_parent":8,"Editors":6,"fw_app":"broadsheet","on.initialize":8,"on.draw":9,"on":1}

View File

@ -1,5 +0,0 @@
on.draw = function()
for _,editor in ipairs(Editors) do
edit.draw(editor)
end
end

View File

@ -1 +0,0 @@
{"fw_parent":9,"Editors":6,"fw_app":"broadsheet","on.initialize":10,"on.draw":9,"on":1}

View File

@ -1,24 +0,0 @@
on.initialize = function(arg)
local font_height = 20
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
break
until width_remaining < editor_width
-- have them all operate on the file's lines
Editors[1].filename = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"fw_parent":10,"on.initialize":10,"on":1,"on.draw":11,"fw_app":"broadsheet"}

View File

@ -1,5 +0,0 @@
on.draw = function()
for _,editor in ipairs(Editors) do
edit.draw(editor, Text_color)
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"fw_parent":11,"on.initialize":10,"on":1,"on.draw":12,"fw_app":"broadsheet"}

View File

@ -1,5 +0,0 @@
on.draw = function()
for _,editor in ipairs(Editors) do
edit.draw(editor, Text_color, --[[hide cursor]] true)
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"fw_parent":12,"on.initialize":13,"on":1,"on.draw":12,"fw_app":"broadsheet"}

View File

@ -1,27 +0,0 @@
on.initialize = function(arg)
local font_height = 20
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
break
until width_remaining < editor_width
-- have them all operate on the file's lines
Editors[1].filename = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color)
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"fw_parent":13,"on.keychord_press":14,"on.initialize":13,"on":1,"on.draw":12,"fw_app":"broadsheet"}

View File

@ -1,5 +1,16 @@
on.keychord_press = function(chord, key)
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, 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)
elseif chord == 'pageup' or chord == 'pagedown' then
edit.keychord_press(Editors[1], chord, key)
resync_editors()
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"fw_parent":14,"on.keychord_press":14,"on.initialize":13,"on":1,"on.draw":12,"fw_app":"broadsheet","on.key_release":15}

View File

@ -1 +0,0 @@
{"on.initialize":13,"on.draw":12,"Editors":6,"fw_parent":15,"on.keychord_press":14,"fw_app":"broadsheet","on":1,"Cursor_editor":16,"on.key_release":15}

View File

@ -1 +0,0 @@
{"on.initialize":13,"on.draw":12,"Editors":6,"fw_parent":16,"on.keychord_press":14,"fw_app":"broadsheet","on":1,"Cursor_editor":16,"on.mouse_press":17,"on.key_release":15}

View File

@ -1,11 +0,0 @@
on.mouse_press = function(x,y, mouse_button)
for _,editor in ipairs(Editors) do
editor.selection1 = {}
end
for _,editor in ipairs(Editors) do
if x >= editor.left and x <= editor.right then
Cursor_editor = editor
edit.mouse_press(editor, x,y, mouse_button)
break
end
end

View File

@ -1 +0,0 @@
{"on.initialize":13,"on.draw":12,"Editors":6,"fw_parent":16,"on.keychord_press":14,"fw_app":"broadsheet","on":1,"Cursor_editor":16,"on.mouse_press":18,"on.key_release":15}

View File

@ -1,12 +0,0 @@
on.mouse_press = function(x,y, mouse_button)
for _,editor in ipairs(Editors) do
editor.selection1 = {}
end
for _,editor in ipairs(Editors) do
if x >= editor.left and x <= editor.right then
Cursor_editor = editor
edit.mouse_press(editor, x,y, mouse_button)
break
end
end
end

View File

@ -1 +0,0 @@
{"on.initialize":13,"on.draw":12,"on.mouse_release":19,"Editors":6,"fw_parent":18,"on.keychord_press":14,"fw_app":"broadsheet","on":1,"Cursor_editor":16,"on.mouse_press":18,"on.key_release":15}

View File

@ -1 +0,0 @@
{"on.initialize":13,"on.draw":12,"on.mouse_release":19,"Editors":6,"fw_parent":19,"on.keychord_press":14,"fw_app":"broadsheet","on":1,"Cursor_editor":16,"on.mouse_press":20,"on.key_release":15}

View File

@ -1,12 +0,0 @@
on.mouse_press = function(x,y, mouse_button)
for _,editor in ipairs(Editors) do
editor.selection1 = {}
end
for _,editor in ipairs(Editors) do
if x >= editor.left and x <= editor.right then
Cursor_editor = editor
edit.mouse_press(editor, x,y, mouse_button)
break
end
end
end

View File

@ -1 +0,0 @@
{"on.keychord_press":14,"on.initialize":21,"fw_parent":20,"on.draw":12,"fw_app":"broadsheet","Editors":6,"on.key_release":15,"on.mouse_release":19,"on.mouse_press":20,"on":1,"Cursor_editor":16}

View File

@ -1,27 +0,0 @@
on.initialize = function(arg)
local font_height = 20
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
print(App.screen.width, editor_width)
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
until width_remaining < editor_width
-- have them all operate on the file's lines
Editors[1].filename = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color)
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
end
end

View File

@ -1 +0,0 @@
{"on.key_release":15,"on.draw":12,"Cursor_editor":16,"Editors":6,"on.mouse_release":19,"fw_app":"broadsheet","on":1,"on.mouse_press":20,"fw_parent":21,"on.keychord_press":14,"on.initialize":22}

View File

@ -1,28 +0,0 @@
on.initialize = function(arg)
local font_height = 20
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
print(App.screen.width, editor_width)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color)
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"on.initialize":23,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":22,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,29 +0,0 @@
on.initialize = function(arg)
local font_height = 20
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
print(App.screen.width, editor_width)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"on.initialize":24,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":23,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,3 +0,0 @@
on.initialize = function(arg)
initialize_editors(20)
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":24,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,3 +0,0 @@
on.initialize = function(arg)
initialize_editors( --[[font height]] 20, --[[screen_top]] {line=1, pos=1})
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":26,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":25,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,28 +0,0 @@
initialize_editors = function(font_height, screen_top1)
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
print(App.screen.width, editor_width)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":27,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":26,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,28 +0,0 @@
initialize_editors = function(font_height, screen_top)
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
print(App.screen.width, editor_width)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":28,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":27,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,27 +0,0 @@
initialize_editors = function(font_height, screen_top)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":29,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":14,"fw_parent":28,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,28 +0,0 @@
initialize_editors = function(font_height, screen_top)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
Editors[1].screen_top = screen_top
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":29,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":30,"fw_parent":29,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,9 +0,0 @@
on.keychord_press = function(chord, key)
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, Editors[1].screen_top1)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":29,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":31,"fw_parent":30,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,13 +0,0 @@
on.keychord_press = function(chord, key)
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, Editors[1].screen_top1)
elseif chord == 'C-=' then
initialize_editors(Editors[1].font_height+2, Editors[1].screen_top1)
elseif chord == 'C--' then
initialize_editors(Editors[1].font_height-2, Editors[1].screen_top1)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":32,"on.initialize":25,"fw_app":"broadsheet","on.keychord_press":31,"fw_parent":31,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,28 +0,0 @@
initialize_editors = function(font_height, screen_top, filename)
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 = arg[1]
load_from_disk(Editors[1])
Text.redraw_all(Editors[1])
Editors[1].screen_top = screen_top
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":32,"on.initialize":33,"fw_app":"broadsheet","on.keychord_press":31,"fw_parent":32,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,3 +0,0 @@
on.initialize = function(arg)
initialize_editors( --[[font height]] 20, --[[screen_top]] {line=1, pos=1}, arg[1])
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":32,"on.initialize":33,"fw_app":"broadsheet","on.keychord_press":34,"fw_parent":33,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,13 +0,0 @@
on.keychord_press = function(chord, key)
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].screen_top1)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":35,"on.initialize":33,"fw_app":"broadsheet","on.keychord_press":34,"fw_parent":34,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,28 +0,0 @@
initialize_editors = function(font_height, filename, screen_top)
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])
Editors[1].screen_top = screen_top
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"Editors":6,"on":1,"on.mouse_release":19,"initialize_editors":35,"on.initialize":36,"fw_app":"broadsheet","on.keychord_press":34,"fw_parent":35,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20}

View File

@ -1,3 +0,0 @@
on.initialize = function(arg)
initialize_editors( --[[font height]] 20, --[[filename]] arg[1], --[[screen_top]] {line=1, pos=1})
end

View File

@ -1 +0,0 @@
{"fw_app":"broadsheet","on.keychord_press":37,"initialize_editors":35,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on":1,"Editors":6,"on.mouse_release":19,"on.mouse_press":20,"on.initialize":36,"fw_parent":36}

View File

@ -1,13 +0,0 @@
on.keychord_press = function(chord, key)
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)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"fw_app":"broadsheet","on":1,"on.keychord_press":38,"initialize_editors":35,"on.key_release":15,"on.draw":12,"Cursor_editor":16,"fw_parent":37,"Editors":6,"on.initialize":36,"on.mouse_press":20,"on.mouse_release":19}

View File

@ -1,13 +0,0 @@
on.keychord_press = function(chord, key)
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)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"fw_app":"broadsheet","on.keychord_press":39,"initialize_editors":35,"on.key_release":15,"Cursor_editor":16,"on.mouse_press":20,"on":1,"on.initialize":36,"on.mouse_release":19,"Editors":6,"on.draw":12,"fw_parent":38}

View File

@ -1,15 +0,0 @@
on.keychord_press = function(chord, key)
local old_editor = Editors[1]
Editors = {}
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C-=' then
initialize_editors(old_editor.font_height+2, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C--' then
initialize_editors(old_editors.font_height-2, old_editor.filename, old_editor.screen_top1)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"on.key_release":15,"on.draw":12,"Cursor_editor":16,"on.mouse_press":20,"on.mouse_release":19,"fw_parent":39,"Editors":6,"initialize_editors":35,"fw_app":"broadsheet","on":1,"on.keychord_press":40,"on.initialize":36}

View File

@ -1,15 +0,0 @@
on.keychord_press = function(chord, key)
local old_editor = Editors[1]
Editors = {}
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C-=' then
initialize_editors(old_editor.font_height+2, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C--' then
initialize_editors(old_editor.font_height-2, old_editor.filename, old_editor.screen_top1)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"on.draw":12,"Cursor_editor":16,"on.mouse_press":20,"fw_parent":40,"on.mouse_release":19,"on.initialize":36,"Editors":6,"on":1,"fw_app":"broadsheet","on.keychord_press":41,"initialize_editors":35,"on.key_release":15}

View File

@ -1,16 +0,0 @@
on.keychord_press = function(chord, key)
assert(#Editors > 0)
local old_editor = Editors[1]
Editors = {}
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C-=' then
initialize_editors(old_editor.font_height+2, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C--' then
initialize_editors(old_editor.font_height-2, old_editor.filename, old_editor.screen_top1)
else
for _,editor in ipairs(Editors) do
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"on.mouse_release":19,"on.key_release":15,"initialize_editors":35,"fw_parent":41,"on.initialize":36,"on":1,"on.draw":12,"Cursor_editor":16,"on.keychord_press":42,"Editors":6,"fw_app":"broadsheet","on.mouse_press":20}

View File

@ -1,18 +0,0 @@
on.keychord_press = function(chord, key)
assert(#Editors > 0)
local old_editor = Editors[1]
Editors = {}
if chord == 'C-0' then
initialize_editors( --[[font height]] 20, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C-=' then
initialize_editors(old_editor.font_height+2, old_editor.filename, old_editor.screen_top1)
elseif chord == 'C--' then
initialize_editors(old_editor.font_height-2, old_editor.filename, old_editor.screen_top1)
else
print(chord)
for _,editor in ipairs(Editors) do
print(editor.selection1.line, editor.selection1.pos)
edit.keychord_press(editor, chord, key)
end
end
end

View File

@ -1 +0,0 @@
{"on.mouse_release":19,"on.key_release":15,"initialize_editors":43,"fw_parent":42,"on.initialize":36,"on":1,"on.draw":12,"Cursor_editor":16,"on.keychord_press":42,"Editors":6,"fw_app":"broadsheet","on.mouse_press":20}

View File

@ -1,29 +0,0 @@
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])
Editors[1].screen_top = screen_top
edit.draw(Editors[1], Text_color) -- initialize screen_bottom1
for e=2,#Editors do
local editor = Editors[e]
editor.lines = Editors[1].lines
editor.line_cache = Editors[1].line_cache
editor.screen_top1 = {line=Editors[e-1].screen_bottom1.line, pos=Editors[e-1].screen_bottom1.pos}
editor.cursor1 = {line=editor.screen_top1.line, pos=editor.screen_top1.pos}
edit.draw(editor, Text_color) -- initialize screen_bottom1
end
end

View File

@ -1 +0,0 @@
{"on.mouse_release":19,"on.key_release":15,"initialize_editors":43,"fw_parent":43,"on.initialize":36,"on":1,"on.draw":12,"Cursor_editor":16,"on.keychord_press":44,"Editors":6,"fw_app":"broadsheet","on.mouse_press":20}

Some files were not shown because too many files have changed in this diff Show More