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 doesn't undo from the first initial change to unmodified file #32582

Closed
jpoirier opened this issue Aug 15, 2017 · 5 comments
Closed

Undo doesn't undo from the first initial change to unmodified file #32582

jpoirier opened this issue Aug 15, 2017 · 5 comments

Comments

@jpoirier
Copy link

  • VSCode Version: Code 1.15.0 (8b95971, 2017-08-09T20:09:15.006Z)
  • OS Version: Linux x64 4.12.5-300.fc26.x86_64
  • Extensions:

Steps to Reproduce:

  1. Add a single modification to an unmodified file, e.g. add a newline

  2. Undo the modification via Ctrl+Z

  3. 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.

@tyson-kubota
Copy link

tyson-kubota commented Aug 15, 2017

  • VSCode : Version 1.15.0 (1.15.0), 8b95971, 2017-08-09T20:02:33.839Z
  • OS Version: macOS 10.12.6
  • Extensions: none

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
Copy link
Member

bpasero commented Aug 16, 2017

#919

@bpasero bpasero closed this as completed Aug 16, 2017
@tyson-kubota
Copy link

@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)?

@bpasero
Copy link
Member

bpasero commented Aug 17, 2017

@tyson-kubota please keep one issue around one topic, if you see multiple issues, file them as individual issues.

@tyson-kubota
Copy link

Thanks. I now see that #32305 already expresses my issue.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants