-
Notifications
You must be signed in to change notification settings - Fork 286
Fix/issue 2593 cursor resets to end of paragraph after paste #2814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix/issue 2593 cursor resets to end of paragraph after paste #2814
Conversation
|
Adding to this: The two failing tests are both unrelated. |
super_editor/lib/src/default_editor/common_editor_operations.dart
Outdated
Show resolved
Hide resolved
super_editor/lib/src/default_editor/common_editor_operations.dart
Outdated
Show resolved
Hide resolved
super_editor/test/super_editor/supereditor_copy_and_paste_test.dart
Outdated
Show resolved
Hide resolved
angelosilvestre
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @JostSchenck. Thanks for the PR. I left a few comments.
super_editor/test/super_editor/supereditor_copy_and_paste_test.dart
Outdated
Show resolved
Hide resolved
6b60d64 to
040233c
Compare
super_editor/lib/src/default_editor/common_editor_operations.dart
Outdated
Show resolved
Hide resolved
super_editor/lib/src/default_editor/common_editor_operations.dart
Outdated
Show resolved
Hide resolved
…mple text (without newlines) in the middle of a paragraph
…ulting in correct selection
…ds correctly placed selection when a) text spanning a single text node is pasted inside a node or at the end of a node, b) text spanning several text nodes is pasted inside a node or at the end of a node. Added test for behavior with multiple nodes. Renamed documentPositionAfterPast > selectionAfterPaste
6443707 to
b375f3b
Compare
This fixes #2593 . Currently, the code silently assumes that when text is pasted, it covers complete nodes, and always places the caret at the end. However, when only some text without paragraphs is pasted into the middle of a paragraph, the user expects the caret to be placed at the end of the inserted text.