Undo does not seem consistent
assembledadam opened this issue · comments
Fairly minor issue here. Here's an example to reproduce (I am using Chrome 50 on a Mac):
- Go to the editor demo.
- Go to a new paragraph, a single word of text.
- Hit enter/return, type a single word of text.
- Hit enter/return, type a single word of text.
- Press the undo button combo (CTRL + Z or CMD + Z). The word you just typed is removed, and the caret is moved to the beginning of the paragraph (as expected).
- Press the undo button combo again. Caret moved to the end of the previous word (as expected).
- Press the undo button combo again. At this point nothing happens, when the expected behavior is to remove the text of that line.
It appears a rogue (blank/empty) operation may be inserted at some point, requiring the user presses undo an extra time during editing. This appears to happen quite a lot, in a few different forms to the above.
Yeah I do see these in few cases and you're right most of the time the reason is that we execute multiple batch of operations to get the final result, I'll look into cases where we're doing this and see if we can consolidate these to be a one batch operation instead. In places this might be difficult to do we need to think of a way to "merge" these batches so the undo operation undo both batches instead of one - this is possible.