use the current implementation in just down-arrow

Now we have a skeleton to support up-arrow. This is probably not a good
final organization, but will hopefully be a good incremental stepping
stone.
This commit is contained in:
Kartik K. Agaram 2023-10-27 16:09:04 -07:00
parent 1031f47496
commit feee7895e9
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,8 @@ function pan_viewport_to_contain_cursor(node)
local safety_margin = 2*node.editor.line_height
print('safety margin', screen_top_y, 'dvpx')
print('node', node.y)
local cursor_sy = node.y + y_of_schema1(node.editor, node.editor.cursor1)
if cursor_sy > Viewport.y + App.screen.height/Viewport.zoom - safety_margin then
local cursor_y = y_of_schema1(node.editor, node.editor.cursor1)
print('cursor', cursor_y, 'dvpx')
if Viewport.y < node.y then
@ -28,4 +30,6 @@ function pan_viewport_to_contain_cursor(node)
print('adjusting Viewport to', Viewport.y)
end
end
elseif cursor_sy < Viewport.y + safety_margin then
end
end