If the only cost is that I need to move things around a little, we can work around it. Either manually or with more surgical logic to detect the need to compute_layout. Let's see if this has other issues.
4EU33OQNAAPCL7VD4W2IGH4ALEXZUUOSN5JYHV6BYSQR7XYRK7FQC
on.keychord_press = function(chord, key)
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
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
elseif Cursor_node then
print('a', Cursor_node.editor.line_cache[1])
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
{"manifest_coord":636,"update_editor_box":711,"manifest_index":637,"on":1,"line_height":365,"on.text_input":521,"sx":544,"schema1_of_y":667,"y_of_schema1":364,"fw_parent":738,"fw_app":"driver","mouse_cursor":558,"font":353,"set_mouse_cursor":562,"draw_ticks":663,"add_def_to_menu":640,"order_of_magnitude":573,"draw_cursor":639,"scale":712,"approximate":579,"Animating":726,"copy_shape":396,"on.draw":565,"vx":545,"tick_spec":660,"Viewport":604,"A":713,"Ticks_font":669,"B":379,"Manifest_navigator":495,"on.mouse_press":722,"initialize_editor":678,"on.mouse_release":721,"on.update":731,"load_definition":716,"compute_layout":385,"Page":475,"Manifest":494,"on.save_settings":702,"load_manifest":694,"on.load_settings":700,"get_manifest":706,"box_height":680,"table_and_array_both_empty":689,"Definitions":503,"on.code_change":734,"new_definition":681,"on.key_release":720,"draw_menu_bar":641,"add_hotkey_to_menu":616,"vy":546,"Mouse_cursor":559,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"Menu_highlight_color":614,"reset_manifest_navigator":621,"maybe_update_key_in_definitions":529,"Menu_border_color":612,"load_from_iterator":670,"Surface":422,"Cursor_node":172,"manifest_navigator_candidates":638,"on_text":539,"Menu_command_color":613,"manifest_navigator_up":628,"on.initialize":695,"manifest_navigator_down":635,"approximate_up":658,"Menu_background_color":611,"delete_definition":673,"add_thick_line":400,"move_candidate_to_front_of_manifest":632,"--":727,"keychord_press_on_manifest_navigator":675,"on_handle":547,"text_input_on_manifest_navigator":634,"on.keychord_press":739}
on.keychord_press = function(chord, key)
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
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
elseif Cursor_node then
print('a', Cursor_node.editor.line_cache[1])
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)
A(--[[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
{"manifest_coord":636,"update_editor_box":711,"manifest_index":637,"on":1,"line_height":365,"on.text_input":521,"sx":544,"schema1_of_y":667,"y_of_schema1":364,"fw_parent":737,"fw_app":"driver","mouse_cursor":558,"font":353,"set_mouse_cursor":562,"draw_ticks":663,"add_def_to_menu":640,"order_of_magnitude":573,"draw_cursor":639,"scale":712,"approximate":579,"Animating":726,"copy_shape":396,"on.draw":565,"vx":545,"tick_spec":660,"Viewport":604,"A":713,"Ticks_font":669,"B":379,"Manifest_navigator":495,"on.mouse_press":722,"initialize_editor":678,"on.mouse_release":721,"on.update":731,"load_definition":716,"compute_layout":385,"Page":475,"Manifest":494,"on.save_settings":702,"load_manifest":694,"on.load_settings":700,"get_manifest":706,"box_height":680,"table_and_array_both_empty":689,"Definitions":503,"on.code_change":734,"new_definition":681,"on.key_release":720,"draw_menu_bar":641,"add_hotkey_to_menu":616,"vy":546,"Mouse_cursor":559,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"Menu_highlight_color":614,"reset_manifest_navigator":621,"maybe_update_key_in_definitions":529,"Menu_border_color":612,"load_from_iterator":670,"Surface":422,"Cursor_node":172,"manifest_navigator_candidates":638,"on_text":539,"Menu_command_color":613,"manifest_navigator_up":628,"on.initialize":695,"manifest_navigator_down":635,"approximate_up":658,"Menu_background_color":611,"delete_definition":673,"add_thick_line":400,"move_candidate_to_front_of_manifest":632,"--":727,"keychord_press_on_manifest_navigator":675,"on_handle":547,"text_input_on_manifest_navigator":634,"on.keychord_press":738}
on.keychord_press = function(chord, key)
print('a')
if Cursor_node then
print(Cursor_node.editor.line_cache[1])
end
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
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
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)
A(--[[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
{"manifest_coord":636,"update_editor_box":711,"manifest_index":637,"on":1,"line_height":365,"on.text_input":521,"sx":544,"schema1_of_y":667,"y_of_schema1":364,"fw_parent":736,"fw_app":"driver","mouse_cursor":558,"font":353,"set_mouse_cursor":562,"draw_ticks":663,"add_def_to_menu":640,"order_of_magnitude":573,"draw_cursor":639,"scale":712,"approximate":579,"Animating":726,"copy_shape":396,"on.draw":565,"vx":545,"tick_spec":660,"Viewport":604,"A":713,"Ticks_font":669,"B":379,"Manifest_navigator":495,"on.mouse_press":722,"initialize_editor":678,"on.mouse_release":721,"on.update":731,"load_definition":716,"compute_layout":385,"Page":475,"Manifest":494,"on.save_settings":702,"load_manifest":694,"on.load_settings":700,"get_manifest":706,"box_height":680,"table_and_array_both_empty":689,"Definitions":503,"on.code_change":734,"new_definition":681,"on.key_release":720,"draw_menu_bar":641,"add_hotkey_to_menu":616,"vy":546,"Mouse_cursor":559,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"Menu_highlight_color":614,"reset_manifest_navigator":621,"maybe_update_key_in_definitions":529,"Menu_border_color":612,"load_from_iterator":670,"Surface":422,"Cursor_node":172,"manifest_navigator_candidates":638,"on_text":539,"Menu_command_color":613,"manifest_navigator_up":628,"on.initialize":695,"manifest_navigator_down":635,"approximate_up":658,"Menu_background_color":611,"delete_definition":673,"add_thick_line":400,"move_candidate_to_front_of_manifest":632,"--":727,"keychord_press_on_manifest_navigator":675,"on_handle":547,"text_input_on_manifest_navigator":634,"on.keychord_press":737}
on.keychord_press = function(chord, key)
if Cursor_node then
print('a', Cursor_node.editor.line_cache[1])
end
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
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
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)
A(--[[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
{"manifest_coord":636,"update_editor_box":711,"manifest_index":637,"on":1,"line_height":365,"on.text_input":521,"sx":544,"schema1_of_y":667,"y_of_schema1":364,"fw_parent":735,"fw_app":"driver","mouse_cursor":558,"font":353,"set_mouse_cursor":562,"draw_ticks":663,"add_def_to_menu":640,"order_of_magnitude":573,"draw_cursor":639,"scale":712,"approximate":579,"Animating":726,"copy_shape":396,"on.draw":565,"vx":545,"tick_spec":660,"Viewport":604,"A":713,"Ticks_font":669,"B":379,"Manifest_navigator":495,"on.mouse_press":722,"initialize_editor":678,"on.mouse_release":721,"on.update":731,"load_definition":716,"compute_layout":385,"Page":475,"Manifest":494,"on.save_settings":702,"load_manifest":694,"on.load_settings":700,"get_manifest":706,"box_height":680,"table_and_array_both_empty":689,"Definitions":503,"on.code_change":734,"new_definition":681,"on.key_release":720,"draw_menu_bar":641,"add_hotkey_to_menu":616,"vy":546,"Mouse_cursor":559,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"Menu_highlight_color":614,"reset_manifest_navigator":621,"maybe_update_key_in_definitions":529,"Menu_border_color":612,"load_from_iterator":670,"Surface":422,"Cursor_node":172,"manifest_navigator_candidates":638,"on_text":539,"Menu_command_color":613,"manifest_navigator_up":628,"on.initialize":695,"manifest_navigator_down":635,"approximate_up":658,"Menu_background_color":611,"delete_definition":673,"add_thick_line":400,"move_candidate_to_front_of_manifest":632,"--":727,"keychord_press_on_manifest_navigator":675,"on_handle":547,"text_input_on_manifest_navigator":634,"on.keychord_press":736}