The meta-driver is growing sluggish now that I have most definitions for the driver visible on the surface. Let's see if this helps.
TQS2PIWKR64MHXPQOC5PYOB3TZAUWAZUSJH55NQOW722LZ76M3LQC
on.text_input = function(t)
print('text input', t)
if Manifest_navigator.show then
text_input_on_manifest_navigator(t)
elseif Cursor_node then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.text_input(Cursor_node.editor, t)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
-- we need to call A sometimes, but redoing compute_layout on every single character is too much
B(--[[preserve screen_top of cursor node]] true)
end
end
{"fw_parent":831,"surface_bounds":814,"font":353,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"Definitions":503,"text_input_on_manifest_navigator":634,"from_viewport":823,"manifest_coord":636,"interpolate_viewport":824,"manifest_index":637,"manifest_navigator_candidates":638,"Cursor_node":172,"copy_shape":396,"add_def_to_menu":640,"B":830,"maybe_update_key_in_definitions":529,"on.mouse_release":721,"on.key_release":720,"Animating":813,"mouse_cursor":558,"y_of_schema1":364,"Mouse_cursor":559,"on.text_input":832,"line_height":365,"draw_cursor":639,"set_mouse_cursor":562,"on.code_change":820,"draw_ticks":663,"on_text":539,"on.mouse_press":722,"scale":712,"order_of_magnitude":573,"sx":544,"vx":545,"approximate":579,"on":1,"approximate_up":658,"Ticks_font":669,"initialize_editor":678,"Manifest_navigator":495,"tick_spec":660,"Page":475,"on.keychord_press":828,"keychord_press_on_manifest_navigator":765,"schema1_of_y":667,"on.update":802,"wait_for_response":781,"on.code_submit":787,"on.initialize":807,"vy":546,"manifest_navigator_down":635,"load_manifest":694,"on_handle":547,"animate_next_frame":825,"Manifest":769,"initialize_manifest_navigator":773,"load_definition":716,"delete_definition":673,"sy":469,"update_editor_box":711,"Menu_background_color":611,"get_multiple_definitions_from_app":783,"Surface":422,"get_manifest":768,"Menu_command_color":613,"on.draw":797,"Menu_highlight_color":614,"draw_run_time_error":808,"draw_menu_bar":641,"Viewport":604,"add_hotkey_to_menu":616,"A":831,"survey_animation":827,"draw_manifest_navigator":677,"animate_next":809,"num_lines_for_manifest_navigator":676,"Menu_border_color":612,"compute_layout":385,"reset_manifest_navigator":772,"fw_app":"driver","box_height":680,"load_from_iterator":670,"new_definition":821,"get_definition_from_app":784,"Spawn_point":822,"on.save_settings":742,"add_thick_line":400,"on.load_settings":782,"manifest_navigator_up":628}
{"schema1_of_y":667,"draw_ticks":663,"Cursor_node":172,"y_of_schema1":364,"on.text_input":829,"order_of_magnitude":573,"load_definition":716,"approximate":579,"on.save_settings":742,"box_height":680,"on.load_settings":782,"approximate_up":658,"table_and_array_both_empty":689,"on.code_change":820,"scale":712,"Ticks_font":669,"initialize_manifest_navigator":773,"get_multiple_definitions_from_app":783,"add_thick_line":400,"copy_shape":396,"Manifest":769,"load_manifest":694,"initialize_editor":678,"Menu_background_color":611,"Menu_border_color":612,"Menu_command_color":613,"Definitions":503,"Menu_highlight_color":614,"font":353,"draw_menu_bar":641,"animate_next":809,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"animate_next_frame":825,"A":831,"reset_manifest_navigator":772,"survey_animation":827,"B":830,"maybe_update_key_in_definitions":529,"get_definition_from_app":784,"add_def_to_menu":640,"surface_bounds":814,"on.keychord_press":828,"compute_layout":385,"manifest_navigator_up":628,"fw_app":"driver","manifest_navigator_down":635,"wait_for_response":781,"new_definition":821,"delete_definition":673,"Spawn_point":822,"move_candidate_to_front_of_manifest":632,"from_viewport":823,"keychord_press_on_manifest_navigator":765,"interpolate_viewport":824,"text_input_on_manifest_navigator":634,"on_handle":547,"get_manifest":768,"manifest_coord":636,"Viewport":604,"Surface":422,"draw_cursor":639,"manifest_navigator_candidates":638,"on.draw":797,"manifest_index":637,"vx":545,"on":1,"sx":544,"load_from_iterator":670,"set_mouse_cursor":562,"vy":546,"on.code_submit":787,"on.initialize":807,"draw_run_time_error":808,"on.key_release":720,"on.mouse_press":722,"Mouse_cursor":559,"on.mouse_release":721,"line_height":365,"on.update":802,"sy":469,"update_editor_box":711,"Animating":813,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Page":475,"tick_spec":660,"fw_parent":830,"on_text":539,"Manifest_navigator":495}
A = function(preserve_screen_top_of_cursor_node)
print('A')
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font
-- translate Definitions to Surface
Surface = {}
for _,node in pairs(Definitions) do
compute_layout(node, node.x,node.y, Surface, preserve_screen_top_of_cursor_node)
end
-- continue the pipeline
B(preserve_screen_top_of_cursor_node)
-- TODO: ugly that we're manipulating editor objects twice
end
{"schema1_of_y":667,"draw_ticks":663,"Cursor_node":172,"y_of_schema1":364,"on.text_input":829,"order_of_magnitude":573,"load_definition":716,"approximate":579,"on.save_settings":742,"box_height":680,"on.load_settings":782,"approximate_up":658,"table_and_array_both_empty":689,"on.code_change":820,"scale":712,"Ticks_font":669,"initialize_manifest_navigator":773,"get_multiple_definitions_from_app":783,"add_thick_line":400,"copy_shape":396,"Manifest":769,"load_manifest":694,"initialize_editor":678,"Menu_background_color":611,"Menu_border_color":612,"Menu_command_color":613,"Definitions":503,"Menu_highlight_color":614,"font":353,"draw_menu_bar":641,"animate_next":809,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"animate_next_frame":825,"A":713,"reset_manifest_navigator":772,"survey_animation":827,"B":830,"maybe_update_key_in_definitions":529,"get_definition_from_app":784,"add_def_to_menu":640,"surface_bounds":814,"on.keychord_press":828,"compute_layout":385,"manifest_navigator_up":628,"fw_app":"driver","manifest_navigator_down":635,"wait_for_response":781,"new_definition":821,"delete_definition":673,"Spawn_point":822,"move_candidate_to_front_of_manifest":632,"from_viewport":823,"keychord_press_on_manifest_navigator":765,"interpolate_viewport":824,"text_input_on_manifest_navigator":634,"on_handle":547,"get_manifest":768,"manifest_coord":636,"Viewport":604,"Surface":422,"draw_cursor":639,"manifest_navigator_candidates":638,"on.draw":797,"manifest_index":637,"vx":545,"on":1,"sx":544,"load_from_iterator":670,"set_mouse_cursor":562,"vy":546,"on.code_submit":787,"on.initialize":807,"draw_run_time_error":808,"on.key_release":720,"on.mouse_press":722,"Mouse_cursor":559,"on.mouse_release":721,"line_height":365,"on.update":802,"sy":469,"update_editor_box":711,"Animating":813,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Page":475,"tick_spec":660,"fw_parent":829,"on_text":539,"Manifest_navigator":495}
B = function(preserve_screen_top_of_cursor_node)
print('B')
-- recompute various aspects based on the current viewport settings
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font so update it
for _,obj in ipairs(Surface) do
if obj.type == 'line' then
obj.zdata = {}
for i=1,#obj.data,2 do
table.insert(obj.zdata, vx(obj.data[i]))
table.insert(obj.zdata, vy(obj.data[i+1]))
end
elseif obj.type == 'bezier' then
zdata = {}
for i=1,#obj.data,2 do
table.insert(zdata, vx(obj.data[i]))
table.insert(zdata, vy(obj.data[i+1]))
end
obj.zdata = love.math.newBezierCurve(zdata):render()
elseif obj.type == 'text' then
if obj.w then
update_editor_box(obj, preserve_screen_top_of_cursor_node)
else
obj.text = love.graphics.newText(love.graphics.getFont(), obj.data)
end
end
end
end
on.text_input = function(t)
print('text input', t)
if Manifest_navigator.show then
text_input_on_manifest_navigator(t)
elseif Cursor_node then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.text_input(Cursor_node.editor, t)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
A(--[[preserve screen_top of cursor node]] true)
end
end
{"schema1_of_y":667,"draw_ticks":663,"Cursor_node":172,"y_of_schema1":364,"on.text_input":829,"order_of_magnitude":573,"load_definition":716,"approximate":579,"on.save_settings":742,"box_height":680,"on.load_settings":782,"approximate_up":658,"table_and_array_both_empty":689,"on.code_change":820,"scale":712,"Ticks_font":669,"initialize_manifest_navigator":773,"get_multiple_definitions_from_app":783,"add_thick_line":400,"copy_shape":396,"Manifest":769,"load_manifest":694,"initialize_editor":678,"Menu_background_color":611,"Menu_border_color":612,"Menu_command_color":613,"Definitions":503,"Menu_highlight_color":614,"font":353,"draw_menu_bar":641,"animate_next":809,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"animate_next_frame":825,"A":713,"reset_manifest_navigator":772,"survey_animation":827,"B":379,"maybe_update_key_in_definitions":529,"get_definition_from_app":784,"add_def_to_menu":640,"surface_bounds":814,"on.keychord_press":828,"compute_layout":385,"manifest_navigator_up":628,"fw_app":"driver","manifest_navigator_down":635,"wait_for_response":781,"new_definition":821,"delete_definition":673,"Spawn_point":822,"move_candidate_to_front_of_manifest":632,"from_viewport":823,"keychord_press_on_manifest_navigator":765,"interpolate_viewport":824,"text_input_on_manifest_navigator":634,"on_handle":547,"get_manifest":768,"manifest_coord":636,"Viewport":604,"Surface":422,"draw_cursor":639,"manifest_navigator_candidates":638,"on.draw":797,"manifest_index":637,"vx":545,"on":1,"sx":544,"load_from_iterator":670,"set_mouse_cursor":562,"vy":546,"on.code_submit":787,"on.initialize":807,"draw_run_time_error":808,"on.key_release":720,"on.mouse_press":722,"Mouse_cursor":559,"on.mouse_release":721,"line_height":365,"on.update":802,"sy":469,"update_editor_box":711,"Animating":813,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Page":475,"tick_spec":660,"fw_parent":828,"on_text":539,"Manifest_navigator":495}
on.keychord_press = function(chord, key)
print('key', chord)
if Animating then return end
if Move then return end
if Manifest_navigator.reload then
load_manifest()
end
if chord == 'C-=' then
-- zoom in
Viewport.zoom = Viewport.zoom+0.1
B()
elseif chord == 'C--' then
-- zoom out
if (Viewport.zoom-0.1)*20 >= 1 then -- disallow font size of 0
Viewport.zoom = Viewport.zoom-0.1
B()
end
elseif chord == 'C-0' then
-- reset zoom
Viewport.zoom = 1.0
B()
elseif chord == 'C-q' then
live.send_to_app('QUIT')
elseif Manifest_navigator.show then
keychord_press_on_manifest_navigator(chord, key)
elseif chord == 'C-n' then
new_definition()
A()
elseif chord == 'C-l' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = false
initialize_manifest_navigator()
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
initialize_manifest_navigator()
elseif Cursor_node then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.keychord_press(Cursor_node.editor, chord, key)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
B(--[[preserve screen_top of cursor node]] true)
else
if chord == 'up' then
Viewport.y = Viewport.y - scale(20)
B()
elseif chord == 'down' then
Viewport.y = Viewport.y + scale(20)
B()
elseif chord == 'left' then
Viewport.x = Viewport.x - scale(50)
B()
elseif chord == 'right' then
Viewport.x = Viewport.x + scale(50)
B()
elseif chord == 'pageup' then
Viewport.y = Viewport.y - App.screen.height/Viewport.zoom
B()
elseif chord == 'S-up' then
Viewport.y = Viewport.y - App.screen.height/Viewport.zoom
B()
elseif chord == 'pagedown' then
Viewport.y = Viewport.y + App.screen.height/Viewport.zoom
B()
elseif chord == 'S-down' then
Viewport.y = Viewport.y + App.screen.height/Viewport.zoom
B()
elseif chord == 'S-left' then
Viewport.x = Viewport.x - App.screen.width/Viewport.zoom
B()
elseif chord == 'S-right' then
Viewport.x = Viewport.x + App.screen.width/Viewport.zoom
B()
end
end
end
{"schema1_of_y":667,"draw_ticks":663,"Cursor_node":172,"y_of_schema1":364,"on.text_input":521,"order_of_magnitude":573,"load_definition":716,"approximate":579,"on.save_settings":742,"box_height":680,"on.load_settings":782,"approximate_up":658,"table_and_array_both_empty":689,"on.code_change":820,"scale":712,"Ticks_font":669,"initialize_manifest_navigator":773,"get_multiple_definitions_from_app":783,"add_thick_line":400,"copy_shape":396,"Manifest":769,"load_manifest":694,"initialize_editor":678,"Menu_background_color":611,"Menu_border_color":612,"Menu_command_color":613,"Definitions":503,"Menu_highlight_color":614,"font":353,"draw_menu_bar":641,"animate_next":809,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"animate_next_frame":825,"A":713,"reset_manifest_navigator":772,"survey_animation":827,"B":379,"maybe_update_key_in_definitions":529,"get_definition_from_app":784,"add_def_to_menu":640,"surface_bounds":814,"on.keychord_press":828,"compute_layout":385,"manifest_navigator_up":628,"fw_app":"driver","manifest_navigator_down":635,"wait_for_response":781,"new_definition":821,"delete_definition":673,"Spawn_point":822,"move_candidate_to_front_of_manifest":632,"from_viewport":823,"keychord_press_on_manifest_navigator":765,"interpolate_viewport":824,"text_input_on_manifest_navigator":634,"on_handle":547,"get_manifest":768,"manifest_coord":636,"Viewport":604,"Surface":422,"draw_cursor":639,"manifest_navigator_candidates":638,"on.draw":797,"manifest_index":637,"vx":545,"on":1,"sx":544,"load_from_iterator":670,"set_mouse_cursor":562,"vy":546,"on.code_submit":787,"on.initialize":807,"draw_run_time_error":808,"on.key_release":720,"on.mouse_press":722,"Mouse_cursor":559,"on.mouse_release":721,"line_height":365,"on.update":802,"sy":469,"update_editor_box":711,"Animating":813,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Page":475,"tick_spec":660,"fw_parent":827,"on_text":539,"Manifest_navigator":495}