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BFWJY4TVIKGJ5LI7E4P4F7Z2CVAGVETA3JHAC
5TTD5NPQPH2XMC552EMPP4WY7GVHR3RM5LCVZWXBQXOOACZMTUNAC
CWDOQLMNGY6BP3QCSQCQ7NG5XZN3QIKPZ5YMQHS3AC53J6QZ5RUQC
TBPJ5WSRM5IKQH7FTAVYTWWUBWW7G2CLT5M6FN7CMPLD6Y77YIWQC
ZSXRELZMBQAH2SURKXJW7XR42WGT6L6DQBBMBMHAHJCVKAANK5HQC
--? print('edit', old_top.line, '=>', Cursor_node.editor.screen_top1.line)
if not eq(Cursor_node.editor.screen_top1, old_top) then
--? print('modifying Viewport', Viewport.y, 'based on', Cursor_node.y, Cursor_node.editor.screen_top1.line, Cursor_node.editor.line_height)
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)/Viewport.zoom
--? print('modified Viewport', Viewport.y)
-- Most of the time, we update the screen_top of nodes from Viewport.y.
-- But here we went the other way.
-- It's very important to avoid creating a recurrence, to avoid running
-- both sides of this feedback loop in a single frame. These apps are
-- not very numerically precise (e.g. we force text lines to start at
-- integer pixels regardless of zoom, because that keeps text crisp),
-- and the computations of Viewport.y and node.top will almost certainly
-- not converge. The resulting bugs are extremely difficult to chase
-- down.
-- The optional skip_updating_screen_top_for arg ensures we don't run
-- the other side of the feedback loop.
A(--[[skip updating screen_top for]] Cursor_node)
return
end
pan_viewport_to_contain_cursor(Cursor_node)