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

Cut, copy and paste create additional undo step #781

Closed
Mgsy opened this issue Jan 23, 2018 · 5 comments Β· Fixed by ckeditor/ckeditor5-undo#80
Closed

Cut, copy and paste create additional undo step #781

Mgsy opened this issue Jan 23, 2018 · 5 comments Β· Fixed by ckeditor/ckeditor5-undo#80
Assignees
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Mgsy
Copy link
Member

Mgsy commented Jan 23, 2018

🐞 Is this a bug report or feature request? (choose one)

  • Bug report

πŸ’» Version of CKEditor

Latest master.

πŸ“‹ Steps to reproduce

  1. Go to http://localhost:8125/ckeditor5-core/tests/manual/article.html.
  2. Select some word.
  3. Cut it.
  4. Undo.

βœ… Expected result

There is only one undo step.

❎ Actual result

There are two undo steps. After performing second undo, editor crashes.

πŸ“ƒ Other details that might be useful

GIF
bug_cke5

Error

ckeditorerror.js:46 Uncaught CKEditorError: model-history-wrong-version: Given base version points to the middle of a delta. Read more: https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/framework/guides/support/error-codes.html#model-history-wrong-version
    at History._getIndex (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:48363:10)
    at History.getDeltas (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:48265:24)
    at getDeltas.next (<anonymous>)
    at transformRangesByDeltas (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:36548:14)
    at transformSelectionRange (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:36523:22)
    at UndoCommand._restoreSelection (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:36440:30)
    at Object.editor.model.enqueueChange [as callback] (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:54118:9)
    at Model._runPendingChanges (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:66437:58)
    at Model.enqueueChange (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:66417:9)
    at UndoCommand.execute (http://192.168.20.71:8125/ckeditor5-core/tests/manual/article.js:54114:21)

Notes
Here is first bad commit - b279e7e

Other information
OS: Windows 10, macOS X
Browser: All browsers

@Mgsy Mgsy added the type:bug This issue reports a buggy (incorrect) behavior. label Jan 23, 2018
@Mgsy Mgsy changed the title Cut creates additional undo step Cut, copy and paste create additional undo step Jan 24, 2018
@Mgsy
Copy link
Member Author

Mgsy commented Jan 24, 2018

It turned out that it's not only cut. If you try to copy some word or paste something, additional undo step will appear.

bug_cke5

@Mgsy Mgsy added this to the iteration 14 milestone Jan 24, 2018
@Reinmar
Copy link
Member

Reinmar commented Jan 25, 2018

Here is first bad commit - b279e7e

While this is a bit strange, I confirmed that this is the first bad revision. Unfortunately, we've been merging so many things at that moment (e.g. license updates) that it didn't help in understanding what caused the problem.

@Reinmar
Copy link
Member

Reinmar commented Jan 25, 2018

I confirmed that this issue can be reproduced with only the EssentialPreset so most likely, the issue is caused by...

Which doesn't help at all.

@scofalik
Copy link
Contributor

The bug is caused by non-document operations that create an (empty) undo step, while they shouldn't. I am on it.

@scofalik
Copy link
Contributor

Will be fixed by ckeditor/ckeditor5-undo#80

Reinmar added a commit to ckeditor/ckeditor5-undo that referenced this issue Feb 22, 2018
Fix: Do not register batches which have only non-document operations. Closes #79. Closes ckeditor/ckeditor5#781.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants