If definition isn't already loaded, load it at the 'spawn point': the origin. Always adjust the viewport to show the definition. Always put the cursor inside the definition.
For now we'll stick to a single location for each definition. Let's see how far this takes us.
PRDLXNAROQL5DCMYD2SIW76INUVGEK3SLNEZEFUXEBNHSAQXNZ2QC
{"load_definition":716,"draw_manifest_navigator":677,"schema1_of_y":667,"approximate":579,"y_of_schema1":364,"on.load_settings":700,"table_and_array_both_empty":689,"on.initialize":695,"Ticks_font":669,"draw_cursor":639,"load_manifest":694,"add_thick_line":400,"copy_shape":396,"sy":469,"scale":712,"update_editor_box":711,"line_height":365,"Definitions":503,"get_manifest":706,"on":1,"Manifest_navigator":495,"font":353,"vx":545,"Viewport":604,"new_definition":681,"vy":546,"on.mouse_press":617,"on.update":561,"maybe_update_key_in_definitions":529,"Surface":422,"num_lines_for_manifest_navigator":676,"Page":475,"on.draw":565,"load_from_iterator":670,"fw_parent":715,"fw_app":"driver","Cursor_node":172,"manifest_navigator_down":635,"on_handle":547,"on.text_input":521,"delete_definition":673,"Menu_border_color":612,"on_text":539,"Menu_command_color":613,"text_input_on_manifest_navigator":634,"add_hotkey_to_menu":616,"manifest_index":637,"manifest_navigator_candidates":638,"reset_manifest_navigator":621,"on.key_release":552,"get_definition_from_app":624,"manifest_navigator_up":628,"mouse_cursor":558,"Mouse_cursor":559,"B":379,"add_def_to_menu":640,"set_mouse_cursor":562,"on.keychord_press":666,"box_height":680,"draw_menu_bar":641,"compute_layout":385,"on.mouse_release":554,"tick_spec":660,"on.code_change":306,"Menu_highlight_color":614,"on.save_settings":702,"order_of_magnitude":573,"draw_ticks":663,"keychord_press_on_manifest_navigator":675,"manifest_coord":636,"sx":544,"approximate_up":658,"A":713,"Manifest":494,"Menu_background_color":611,"initialize_editor":678,"move_candidate_to_front_of_manifest":632}
load_definition = function(name)
move_candidate_to_front_of_manifest(name)
if Cursor_node then
Cursor_node.show_cursor = false
end
-- just one copy per definition for now
if Definitions[name] == nil then
Definitions[name] = {
type='text',
data=load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+")),
x=0, y=0,
width=600,
bg={r=0.7,g=0.7,b=1},
}
end
Viewport.x = Definitions[name].x-30
Viewport.y = Definitions[name].y-30
Cursor_node = Definitions[name]
Cursor_node.show_cursor = true
end
{"load_definition":715,"draw_manifest_navigator":677,"schema1_of_y":667,"approximate":579,"y_of_schema1":364,"on.load_settings":700,"table_and_array_both_empty":689,"on.initialize":695,"Ticks_font":669,"draw_cursor":639,"load_manifest":694,"add_thick_line":400,"copy_shape":396,"sy":469,"scale":712,"update_editor_box":711,"line_height":365,"Definitions":503,"get_manifest":706,"on":1,"Manifest_navigator":495,"font":353,"vx":545,"Viewport":604,"new_definition":681,"vy":546,"on.mouse_press":617,"on.update":561,"maybe_update_key_in_definitions":529,"Surface":422,"num_lines_for_manifest_navigator":676,"Page":475,"on.draw":565,"load_from_iterator":670,"fw_parent":714,"fw_app":"driver","Cursor_node":172,"manifest_navigator_down":635,"on_handle":547,"on.text_input":521,"delete_definition":673,"Menu_border_color":612,"on_text":539,"Menu_command_color":613,"text_input_on_manifest_navigator":634,"add_hotkey_to_menu":616,"manifest_index":637,"manifest_navigator_candidates":638,"reset_manifest_navigator":621,"on.key_release":552,"get_definition_from_app":624,"manifest_navigator_up":628,"mouse_cursor":558,"Mouse_cursor":559,"B":379,"add_def_to_menu":640,"set_mouse_cursor":562,"on.keychord_press":666,"box_height":680,"draw_menu_bar":641,"compute_layout":385,"on.mouse_release":554,"tick_spec":660,"on.code_change":306,"Menu_highlight_color":614,"on.save_settings":702,"order_of_magnitude":573,"draw_ticks":663,"keychord_press_on_manifest_navigator":675,"manifest_coord":636,"sx":544,"approximate_up":658,"A":713,"Manifest":494,"Menu_background_color":611,"initialize_editor":678,"move_candidate_to_front_of_manifest":632}
load_definition = function(name)
move_candidate_to_front_of_manifest(name)
if Definitions[name] then
-- just one copy per definition for now
if Cursor_node then
Cursor_node.show_cursor = false
end
Viewport.x = Definitions[name].x-30
Viewport.y = Definitions[name].y-30
Cursor_node = Definitions[name]
Cursor_node.show_cursor = true
return
end
Definitions[name] = {
type='text',
data=load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+")),
x=0, y=0,
width=600,
bg={r=0.7,g=0.7,b=1},
}
end
{"reset_manifest_navigator":621,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":624,"update_editor_box":711,"Manifest":494,"manifest_navigator_up":628,"manifest_navigator_down":635,"on.draw":565,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"on_handle":547,"text_input_on_manifest_navigator":634,"fw_parent":713,"manifest_coord":636,"on_text":539,"manifest_index":637,"manifest_navigator_candidates":638,"Page":475,"sx":544,"vx":545,"on.save_settings":702,"on.load_settings":700,"on.key_release":552,"table_and_array_both_empty":689,"on.initialize":695,"get_manifest":706,"load_manifest":694,"tick_spec":660,"set_mouse_cursor":562,"y_of_schema1":364,"draw_ticks":663,"compute_layout":385,"schema1_of_y":667,"Viewport":604,"new_definition":681,"order_of_magnitude":573,"font":353,"load_definition":714,"A":713,"approximate":579,"Surface":422,"box_height":680,"approximate_up":658,"Ticks_font":669,"add_thick_line":400,"copy_shape":396,"on":1,"on.text_input":521,"draw_cursor":639,"fw_app":"driver","Cursor_node":172,"add_hotkey_to_menu":616,"vy":546,"scale":712,"line_height":365,"sy":469,"on.code_change":306,"Menu_background_color":611,"initialize_editor":678,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.mouse_press":617,"Menu_highlight_color":614,"on.mouse_release":554,"draw_menu_bar":641,"on.update":561,"Manifest_navigator":495,"on.keychord_press":666,"add_def_to_menu":640,"draw_manifest_navigator":677,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"B":379,"Mouse_cursor":559}
load_definition = function(name)
move_candidate_to_front_of_manifest(name)
if Definitions[name] then
-- just one copy per definition for now
Viewport.x = Definitions[name].x-30
Viewport.y = Definitions[name].y-30
Cursor_node = Definitions[name]
return
end
Definitions[name] = {
type='text',
data=load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+")),
x=0, y=0,
width=600,
bg={r=0.7,g=0.7,b=1},
}
end