-
Notifications
You must be signed in to change notification settings - Fork 236
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
After undo/redo, new text is inserted at the end #912
Comments
Thanks for reporting have started looking into it, will continue next week. |
Hi Christopher, |
Hey @Jugen, thanks for looking into this! From what I can tell, the problem is indeed resolved. There is one oddity I noticed, however: when undoing a text removal or undoing a style change over a segment of text, the cursor is then placed at the beginning of that change segment. The standard behaviour for this kind of an undo change is to conclude the undo operation with the entire range of text being selected, so RichTextFX's behaviour feels a bit strange here. I do realize, however, that this does not really fall within the purview of this issue. If it were possible to tell whether a change is an undo/redo or a normal text change (as in from a paste), this would definitely be something I would implement on my own, but I don't believe there is any way to distinguish the two, is there? |
The changes I made are in If I'm not mistaken I think |
Expected Behavior
When a text change is undone or redone, the
selection
should stay where the caret is so that subsequent text insertions originate from the caret position.Actual Behavior
When a text change is undone or redone, the
selection
jumps to the end of the document (from what I can tell, neithercaretPosition
noranchor
are affected). Subsequent text insertions (if the caret is not manually moved in the meantime) place new text at the end rather than at the caret position.Note that, from what I can tell, this only occurs on text changes, not style changes.
Reproducible Demo
Occurs as-is in the latest version (revision c9a002b) of the RichTextDemo.
Steps:
Might be related to #780 / #785.
The text was updated successfully, but these errors were encountered: