Added TextNode.selectEnd / Renamed TextNode.selectAfter to .selectNext#109
Merged
Conversation
Collaborator
|
So you want it to select the end of the immutable/segmented node? I thought this would break, because these types of nodes are marked as "contenteditable=false", so they should never be part of the selectable editor space. |
Member
Author
|
@trueadm - The end of a mutable node. Place the cursor just at the end of that node |
Collaborator
|
This seems to break a bunch of tests, mind looking into it? |
Member
Author
|
@trueadm - Sorry, shouldn't have published a half-baked PR. Added a new test for |
trueadm
approved these changes
Feb 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
selectAfterworks well most of the times. But there's some cases when the next Node is immutable that you either want to move the cursor before or after, not to the immutable node.For reference:
This diff doesn't implement a recursive solution to the immutable nodes to follow, but the introduction of
selectEndshould fix the first, move the cursor just at the end of the node you're working with.That said, this diff is very opinionated so I'm happy to drop it entirely.