Merge luaML.love

Manual tests look identical, but I did actually take the trouble to run
them all with driver.love.
This commit is contained in:
Kartik K. Agaram 2023-10-26 13:37:11 -07:00
commit a5b090c9f0
2 changed files with 89 additions and 10 deletions

View File

@ -51,7 +51,7 @@ on.keychord_press = function(chord, key)
local definition_name = live.get_definition_name_from_buffer(live.definition_to_string(Cursor_node.editor))
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
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)
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)/Viewport.zoom
-- 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

View File

@ -6,7 +6,7 @@ record those here.
Initializing settings:
- from previous session
- from defaults
- default_map absent/present
- `default_map` absent/present
- when connecting to a new app
* How the screen looks. Our tests use a level of indirection to check text and
@ -14,14 +14,93 @@ Initializing settings:
- where exactly the cursor is drawn to highlight a given character
- analogously, how a shape precisely looks as you draw it
Panning (test these at multiple zoom levels):
* When no node has cursor, arrow keys and pageup/pagedown pan surface around, preserving relative positions of nodes
* When a node has cursor in viewport, arrow keys move the cursor within the node, keeping cursor visible, panning surface if scrolling is needed
* Pageup/pagedown scroll a whole viewport height at a time if possible, but keep cursor visible if not possible.
* When a node has cursor, pageup/pagedown pan surface around
* Position a node with some of its area above (outside) viewport. Position cursor at topmost row on screen. Hit up arrow. Surface pans. Cursor doesn't hide behind menu bar.
* Increase/decrease zoom, pan around using cursor inside node. The box for the editor surrounds the entire editor.
* Increase/decrease zoom, pan around using cursor outside node. The box for the editor surrounds the entire editor. (not perfect yet)
Panning:
* Zoom = 1
short node entirely within viewer, cursor in middle of screen
✓ arrow keys
✓ page-up positions cursor on top line
x page-down positions cursor on bottom line (weirdness with blank box)
✓ mouse panning
tall node extending below viewport
x repeated down arrow near bottom pans down
✓ repeated up arrow
✓ repeated down arrow
x repeated pagedown
✓ repeated pageup
✓ mouse panning
tall node extending above viewport
✓ repeated up arrow near top pans up
✓ repeated down arrow
✓ repeated up arrow
✓ repeated pagedown
✓ repeated pageup
✓ mouse panning
tall node extending both below and above viewport
✓ repeated up arrow near top pans up
✓ repeated down arrow
✓ repeated down arrow near bottom pans down
✓ repeated up arrow
✓ repeated pagedown
✓ repeated pageup
✓ mouse panning
* Zoom > 1 (e.g. ctrl+0 ctrl+= ctrl+=)
short node entirely within viewer, cursor in middle of screen
✓ arrow keys
✓ page-up positions cursor on top line
x page-down positions cursor on bottom line
✓ mouse panning
tall node extending below viewport
x repeated down arrow near bottom pans down
✓ repeated up arrow
✓ repeated down arrow
x repeated pagedown
✓ repeated pageup
✓ mouse panning
tall node extending above viewport
✓ repeated up arrow near top pans up
✓ repeated down arrow
✓ repeated up arrow
✓ repeated pagedown
✓ repeated pageup
✓ mouse panning
tall node extending both below and above viewport
✓ repeated up arrow near top pans up
✓ repeated down arrow
✓ repeated down arrow near bottom pans down
✓ repeated up arrow
✓ repeated pagedown
✓ repeated pageup
✓ mouse panning
* Zoom < 1 (e.g. ctrl+0 ctrl+- ctrl+-)
short node entirely within viewer, cursor in middle of screen
✓ arrow keys
✓ page-up positions cursor on top line
x page-down positions cursor on bottom line
✓ mouse panning
tall node extending below viewport
x repeated down arrow near bottom pans down
✓ repeated up arrow
✓ repeated down arrow
x repeated pagedown
✓ repeated pageup
✓ mouse panning
tall node extending above viewport
✓ repeated up arrow near top pans up
✓ repeated down arrow
✓ repeated up arrow
✓ repeated pagedown
✓ repeated pageup
✓ mouse panning
tall node extending both below and above viewport
✓ repeated up arrow near top pans up
✓ repeated down arrow
✓ repeated down arrow near bottom pans down
✓ repeated up arrow
✓ repeated pagedown
✓ repeated pageup
✓ mouse panning
### Protocol with driver; error-handling