PBREXBI62EXGQAYPXRATHZE57UZ4PCEVEBCZVTQV6KY5EFGCURTQC
update_editor_box = function(node, preserve_screen_top_of_cursor_node)
if node.editor == nil then return end
-- Compute screen_top1 in viewport coordinates because the editor's font takes scaling into account.
if vy(node.y) > 0 then
if not preserve_screen_top_of_cursor_node or node ~= Cursor_node then
node.editor.screen_top1.line = 1
node.editor.screen_top1.pos = 1
end
node.editor.top = vy(node.y)
else
node.editor.screen_top1, node.editor.top = schema1_of_y(node.editor, -vy(node.y))
end
edit.update_font_settings(node.editor, scale(20))
node.editor.left = math.floor(vx(node.x)) + Line_number_width*App.width(node.editor.em)
node.editor.right = math.ceil(vx(node.x+node.w))
Text.redraw_all(node.editor)
end
{"y_of_schema1":364,"set_mouse_cursor":562,"on.text_input":521,"draw_ticks":566,"font":353,"vy":546,"maybe_update_key_in_definitions":529,"on.keychord_press":569,"on":1,"sy":469,"Manifest_navigator":495,"line_height":365,"Cursor_node":172,"parent":569,"add_thick_line":400,"copy_shape":396,"B":379,"compute_layout":385,"on.code_change":306,"Mouse_cursor":559,"A":507,"Definitions":503,"on.initialize":506,"Manifest":494,"sx":544,"Surface":422,"vx":545,"Page":475,"on.draw":565,"new_definition":504,"update_editor_box":570,"on.update":561,"Viewport":567,"load_manifest":496,"box_height":345,"get_manifest":497,"on_text":539,"on_handle":547,"on.key_release":552,"schema1_of_y":467,"on.mouse_press":556,"mouse_cursor":558,"on.mouse_release":554,"initialize_editor":450,"scale":7}
on.keychord_press = function(chord, key)
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
Viewport.zoom = Viewport.zoom-0.1
B()
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()
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
{"on.initialize":506,"Viewport":567,"A":507,"y_of_schema1":364,"maybe_update_key_in_definitions":529,"on":1,"sy":469,"Cursor_node":172,"box_height":345,"line_height":365,"Manifest":494,"on_handle":547,"Surface":422,"on.draw":565,"initialize_editor":450,"new_definition":504,"sx":544,"on.key_release":552,"vx":545,"font":353,"on_text":539,"scale":7,"on.mouse_press":556,"parent":568,"on.mouse_release":554,"load_manifest":496,"copy_shape":396,"get_manifest":497,"on.keychord_press":569,"update_editor_box":479,"on.update":561,"on.code_change":306,"Page":475,"mouse_cursor":558,"Definitions":503,"Mouse_cursor":559,"compute_layout":385,"on.text_input":521,"B":379,"add_thick_line":400,"Manifest_navigator":495,"draw_ticks":566,"vy":546,"set_mouse_cursor":562,"schema1_of_y":467}