Skip to content
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

Markers incorrectly recreated after undo-redo-undo #4480

Closed
scofalik opened this issue Feb 7, 2019 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1669
Closed

Markers incorrectly recreated after undo-redo-undo #4480

scofalik opened this issue Feb 7, 2019 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1669
Assignees

Comments

@scofalik
Copy link
Contributor

scofalik commented Feb 7, 2019

This issue happens during track changes and is connected with markers transformation in undo.

Steps to reproduce

  1. Turn on track changes mode.
  2. Create an insertion suggestion.
  3. Make a selection a little bigger than the suggestion.
  4. Remove (with track changes off).
  5. Undo, undo, redo, redo, undo.
  6. Marker is restored only on one letter.

What happened?

When characters are inserted (step 2) separate operations are created, each for one character and one marker change.

The remove is fine. Then first undo bring back all letters together. The next undo, again, removes each letter separately. Then goes first redo. It brings back each letter separately. Then goes another redo. But it does not removes all the letters separately because it gets transformed by previous operations. So actually this becomes multiple operations. After each of those operations marker range is transformed, it gets shrunk and then it is removed when it goes to graveyard with the last letter. Then, on the last undo, the marker is brought backwith the last removed letter but it is not expanded back.

We have a mechanism that should prevent that but it has incorrect condition to kick-in at the moment. It seemed that the condition is okay, but this case shows that we need to create MarkerOperation for undo purposes (for saving marker state) more often.

@scofalik scofalik self-assigned this Feb 7, 2019
pjasiun referenced this issue in ckeditor/ckeditor5-engine Feb 8, 2019
Fix: `MarkerOperation` transformation in undo. Closes #1668.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants