NEKDLX527DBB62P6OYFMSYAMTLRHNBRDNXNEVFT6UR4JLNOJXWKQC on.keychord_press = function(chord, key)if chord == 'C-=' then-- zoom inViewport.zoom = Viewport.zoom+0.1B()elseif chord == 'C--' then-- zoom outViewport.zoom = Viewport.zoom-0.1B()elseif chord == 'C-0' then-- reset zoomViewport.zoom = 1.0B()elseif chord == 'C-up' thenif Cursor_node.in_reply_to_id thenCursor_node = Nodes[Cursor_node.in_reply_to_id]ensure_cursor_node_within_viewport()endelseif chord == 'C-down' thenif Cursor_node.children and #Cursor_node.children > 0 thenCursor_node = Nodes[Cursor_node.children[1]]ensure_cursor_node_within_viewport()endelseif chord == 'C-left' thenif Cursor_node.in_reply_to_id thenlocal parent = Nodes[Cursor_node.in_reply_to_id]assert(parent.children)if #parent.children > 1 thenlocal idx = array.find(parent.children, Cursor_node.id)if idx > 1 thenCursor_node = Nodes[parent.children[idx-1]]ensure_cursor_node_within_viewport()endendendelseif chord == 'C-right' thenif Cursor_node.in_reply_to_id thenlocal parent = Nodes[Cursor_node.in_reply_to_id]assert(parent.children)if #parent.children > 1 thenlocal idx = array.find(parent.children, Cursor_node.id)if idx < #parent.children thenCursor_node = Nodes[parent.children[idx+1]]ensure_cursor_node_within_viewport()endendendendend
{"Surface":588,"vy":8,"on.draw":632,"Nodes":593,"add_node":590,"Viewport":303,"on.mouse_release":586,"on.initialize":446,"Input_filename":436,"on":1,"dehtml":456,"line_height":365,"ensure_cursor_node_within_viewport":643,"load_from_iterator":463,"add_edge":575,"compute_ntracks":598,"compute_layout":619,"render_thread_to_surface":626,"copy_shape":396,"on.keychord_press":644,"render_node_and_descendants":633,"Cursor_node":172,"add_thick_line":400,"ntracks":600,"update_editor_box":430,"scale":7,"y_of_schema1":364,"on.text_input":587,"on.update":368,"fw_parent":643,"initialize_editor":338,"schema1_of_y":366,"to_text":180,"box_height":345,"A":582,"font":353,"to_node":611,"fw_app":"mastodon-unfurl","on.code_change":578,"split_lines":469,"B":379,"on.mouse_press":618,"vx":5}
{"Surface":588,"vy":8,"on.draw":632,"Nodes":593,"add_node":590,"Viewport":303,"on.mouse_release":586,"on.initialize":446,"Input_filename":436,"on":1,"dehtml":456,"line_height":365,"ensure_cursor_node_within_viewport":643,"load_from_iterator":463,"add_edge":575,"compute_ntracks":598,"compute_layout":619,"render_thread_to_surface":626,"copy_shape":396,"on.keychord_press":642,"render_node_and_descendants":633,"Cursor_node":172,"add_thick_line":400,"ntracks":600,"update_editor_box":430,"scale":7,"y_of_schema1":364,"on.text_input":587,"on.update":368,"fw_parent":642,"initialize_editor":338,"schema1_of_y":366,"to_text":180,"box_height":345,"A":582,"font":353,"to_node":611,"fw_app":"mastodon-unfurl","on.code_change":578,"split_lines":469,"B":379,"on.mouse_press":618,"vx":5}
ensure_cursor_node_within_viewport = function()local snode = Cursor_node.surface_nodelocal dirty-- check Viewport.yif snode.y < Viewport.y thenViewport.y = snode.y - 50dirty = trueendlocal limit = snode.y + box_height(snode)if Viewport.y < limit - App.screen.height/Viewport.zoom thenViewport.y = limit - (App.screen.height-50)/Viewport.zoomdirty = trueend-- check Viewport.xif Cursor_node.surface_node.x < Viewport.x thenViewport.x = Cursor_node.surface_node.x - 50dirty = trueendlimit = snode.x + 600if Viewport.x < limit - App.screen.width/Viewport.zoom thenViewport.x = limit - (App.screen.width-50)/Viewport.zoomdirty = trueend-- refresh if necessaryif dirty thenB()endend