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

History redo should keep first selection #659

Closed
lishid opened this issue Dec 30, 2021 · 2 comments
Closed

History redo should keep first selection #659

lishid opened this issue Dec 30, 2021 · 2 comments

Comments

@lishid
Copy link

@lishid lishid commented Dec 30, 2021

Currently, if a selection event happens after an edit event (even if it's really far from the edit), then the selection event will be combined into the edit event when being re-done. This causes a redo to scroll the document to a different place in the document, where the changes applied by the redo would be possibly out of view.

I would argue that when re-doing, users expect the cursor to be put immediately where the edit happened, rather than somewhere else.

In this demonstration, I type some letters, click at the end of the file, then attempt to undo, then redo.
Expected: See the text that was re-done.
Actual: Can't see it because I was scrolled to the end.
test

@marijnh
Copy link
Member

@marijnh marijnh commented Jan 3, 2022

Good point. Does attached patch work for you?

@lishid
Copy link
Author

@lishid lishid commented Jan 3, 2022

Works for me, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants