Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

wip: Leaf Cursor Navigation + Simple Editing #16

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Conversation

mjakeman
Copy link
Owner

Uses the 'Leaf Navigation' approach from #11.

Allows for very simple insertion/deletion:

  • Press 'a' to insert the letter a as an identifier
  • Press backspace to delete backwards
  • Press delete to delete forwards
Lasem.Cursor.Demo.2.mp4

LsmMathmlView can determine which element is at the
given coordinates (in 'equation scale') and return
it to the caller for introspection.

Implements support for this in the demo.
In addition to type and cursor X/Y, we should report the
position, width, height, and depth of the node.
Navigate through the DOM using the left and right
arrow keys. The cursor keeps track of an active element
as well as a position index within the element.
A very primitive approach at finding the nearest
insertion point. A better solution would use the distance
between lines (accounting for differences in element
heights) rather than midpoints.

This is a welcome start however.
Instead of midpoints, as is done currently. Yields more
reliable results.
Loop until we find a caret location not associated with
the parent element. Works well enough for the mean time,
but has some problems with e.g. fractions.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant