Closed xorgy closed 3 weeks ago
I promise that if you file an issue, I will write tests at some point for PlainEditor
; if for no other reason than to catch issues in upcoming Cursor
changes.
A bit late, but LGTM.
I forgot about affinity semantics. With AccessKit, the client (e.g. screen reader) can theoretically specify the affinity at both ends when setting the selection, though I don't think any of the platform accessibility APIs actually allow that.
@DJMcNab @mwcampbell Yeah, this is a bit of a mess right now with how Cursor
currently works, I intend to add some fns to Cursor
that make it easier to model ‘insertion’ and other behaviors, but the fundamental issue is that Cursors can't be constructed where index
= buffer.len()
, which makes all of these behaviors highly conditional (because inserting at the end of the buffer always has to be len() - 1
with Downstream
affinity).
If we make a Cursor
type that is based on an insertion index first, like the Parley 0.1 Cursor
, then all these behaviors become much easier (because we can just always have Upstream
affinity when inserting, and the neutral empty cursor at index
= 0 suddenly makes sense)