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

Settings for Disabled Persisted Undo #94778

Closed
calendee opened this issue Apr 9, 2020 · 12 comments · Fixed by #96317
Closed

Settings for Disabled Persisted Undo #94778

calendee opened this issue Apr 9, 2020 · 12 comments · Fixed by #96317
Assignees
Labels
feature-request Request for new features or functionality undo-redo Issues around undo/redo verified Verification succeeded
Milestone

Comments

@calendee
Copy link

calendee commented Apr 9, 2020

Version Info:
Version: 1.44.0
Commit: 2aae1f2
Date: 2020-04-08T08:23:56.137Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.3.0

Hello,

The newest release of VS Code has a "persisted undo stack". It would be great to have a setting to disable this. In my workflow, I frequently close files for the specific purpose of disabling the undo stack. When I reopen files, I would not find it useful to be able to undo in them.

Thanks!

@calendee
Copy link
Author

calendee commented Apr 9, 2020

FYI: Completely closing VS Code seems to be a temporary workaround to bust this persisted undo cache.

@mmghv
Copy link

mmghv commented Apr 10, 2020

Also adding an option to clear the undo stack for the current file would be useful.

When do I need that? for example when I commit some changes, I need to clear the undo stack so when I do some experiments I can spam Ctrl + Z to get to the initial state, and then maybe go couple of steps forward (redo).

I usually did this "clear undo" by reopening the file, now it won't work, don't get me wrong, this new "persisted undo" feature is great, but it needs a way to clear the undo to go with it.

@leosdad
Copy link

leosdad commented Apr 11, 2020

Yes, please expose this as an option. In my case, I keep internal backups and I want the Undo/Redo history to be gone as soon as I close the file. In fact I'd also like to have the option to clear it at will, like some old-style code editors did (it was called Clear Undo history, I believe).

@esd3v
Copy link

esd3v commented Apr 12, 2020

I frequently close files for the specific purpose of disabling the undo stack. When I reopen files, I would not find it useful to be able to undo in them.

Same. Add an option for this, please.

@ghost
Copy link

ghost commented Apr 15, 2020

I work around the lack of this option by binding a shortcut to the Developer: Reload window command, so I can clear the undo history whenever I want. (This is what I do normally anyway, when I want to clear the undo history without closing all my files and reopening them.)

However, i'd much prefer to have an option to disable the new behavior for the times where I want to clear the undo history of a given file by simply closing it. Alternatively, I'd like a command to clear the undo history for the current document as well as a specific command to clear the undo history for the whole workspace.

My own concern is for same reason stated by @mmghv - so can spam Ctrl+Z when I'm prototyping. Aside from that, the behavior is uncommon and unexpected.

@khanakia
Copy link

khanakia commented Apr 17, 2020

I am having the same issue. I do not want to undo files once the tabs are closed. Please add an option to disable persistent undo.

@ehaynes99
Copy link

This is particularly nefarious if you just happen to have a file open during an external change (e.g. a git pull or git checkout). Days later you can accidentally "revert" individual files from those commits. I realize that this is technically possible prior to this feature, but it's far more likely now.

@alexdima
Copy link
Member

Starting with the next Insiders build, this can be effectively turned off via "files.maxMemoryForClosedFilesUndoStackMB": 0. I will bring up the name in tomorrow's stand-up meeting and keep you posted if we rename the setting.

@alexdima alexdima added the verification-needed Verification of issue is requested label Apr 28, 2020
@mmghv
Copy link

mmghv commented Apr 28, 2020

@alexdima Great, thank you.
Do you think it's possible to add a command to clear undo history for current file/session? that would honestly be very useful and would allow for more control while trying benefiting from the "persist undo" feature, should I open a new issue for that?

@aeschli aeschli added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Apr 29, 2020
@aeschli
Copy link
Contributor

aeschli commented Apr 29, 2020

Verified that setting to 0 will no longer remember undos for closed editor

@mmghv
Copy link

mmghv commented Apr 29, 2020

Opened issue #96601 to add a command for clearing undo history.

@alexdima
Copy link
Member

I have received feedback in the standup and the setting will now be replaced by files.restoreUndoStack which can be set to true or false, starting with the next insiders build.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality undo-redo Issues around undo/redo verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants