-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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 doesn't undo from the first initial change to unmodified file #32582
Comments
A probably-related issue that snuck into a recent release: Auto-formatting seems to now add an extra step in the undo history. So pasting into a (JavaScript) file will auto-indent the pasted portion, but pressing command-Z (or choosing Edit->Undo in the UI) only undoes the auto-indentation, and not the pasting itself. The result is that it takes two invocations of undo to remove pasted content. |
@bpasero I understand if the save/dirty-checking behavior is the same cause as #919 (I didn't realize this hole went so deep), but is my issue above related (#32582 (comment) — a recent regression with the latest release, as far as I can tell)? |
@tyson-kubota please keep one issue around one topic, if you see multiple issues, file them as individual issues. |
Thanks. I now see that #32305 already expresses my issue. |
Steps to Reproduce:
Add a single modification to an unmodified file, e.g. add a newline
Undo the modification via Ctrl+Z
The file stays tagged as modified but should go back to its unmodified state without having to save it; doing a save means a formatter may reformat the file, which is not what's desired.
E.g. I open a project's json file and add some info to it then hit save but the file gets reformatted when I save it, the new formatting is undesired so I click undo to get back to the file's original state. The file goes back to the original state text wise but is still tagged as modified and I have to hit save again which kicks in the formatter again. So if I open a file and make a change there's potentially no way to get the file back to it's unchanged state without disabling the formatters since I always have to hit save even though I've undone all the changes.
The text was updated successfully, but these errors were encountered: