You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
Reacted by Justin Nipper, A. J. Vargas, Simon Chan, meboev, Mohamed Gharib, Andrej Pavlovic, 윤상민, Simon, esd3v, Jacob Weber, Philip Waritschlager and 21 more
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.
Reacted by Calendee LLC, Danny Asmussen, Esteban Hernández and Rob Crawford
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).
Reacted by Calendee LLC, Danny Asmussen, Esteban Hernández and Rob Crawford
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.
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.
Reacted by Calendee LLC, Ethan Sharabi, Esteban Hernández, Flawid D'Souza and Rob Crawford
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.
Alexandru Dima (@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?
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.
Reacted by Victor GUTT, meboev, Paul-Michael Schreiber and Trung Vo
Activity
calendee commentedon Apr 9, 2020
FYI: Completely closing VS Code seems to be a temporary workaround to bust this persisted undo cache.
mmghv commentedon 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 + Zto 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 commentedon 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 commentedon Apr 12, 2020
Same. Add an option for this, please.
khanakia commentedon 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 commentedon Apr 23, 2020
This is particularly nefarious if you just happen to have a file open during an external change (e.g. a
git pullorgit 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 commentedon Apr 28, 2020
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.mmghv commentedon Apr 28, 2020
Alexandru Dima (@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 commentedon Apr 29, 2020
Verified that setting to 0 will no longer remember undos for closed editor
mmghv commentedon Apr 29, 2020
Opened issue #96601 to add a command for clearing undo history.
alexdima commentedon Apr 30, 2020
I have received feedback in the standup and the setting will now be replaced by
files.restoreUndoStackwhich can be set totrueorfalse, starting with the next insiders build.