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

undo bunch of insert instead of undo single characters #217

Open
syntonym opened this issue May 3, 2015 · 1 comment
Open

undo bunch of insert instead of undo single characters #217

syntonym opened this issue May 3, 2015 · 1 comment
Labels
Milestone

Comments

@syntonym
Copy link
Contributor

syntonym commented May 3, 2015

Currently undo does not undo an "insert" but instead undos single characters. Entering insert mode, typing something and then leaving insert mode should probably be treated as a single "do-event".

@stefanoborini
Copy link
Owner

Possible solutions would be to pack the insertion events as they are added to the history queue.
Otherwise we need to keep track of many changes at once on the TextDocument without using the command classes, which would probably prove nasty.

Every time a new Insert command is pushed into the command history, the command history checks the top of the undo queue. If the commands are compatible (eg. are both insert event), then we issue merged = command1.merge(command2) , and push merged back into the queue.

@stefanoborini stefanoborini added this to the v1.8 milestone May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants