Skip to content

Settings for Disabled Persisted Undo #94778

Closed

Description

@calendee

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!

Activity

  1. calendee commented on Apr 9, 2020

    @calendee
    Author

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

  2. mmghv commented on Apr 10, 2020

    @mmghv

    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.

  3. leosdad commented on Apr 11, 2020

    @leosdad

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

  4. esd3v commented on Apr 12, 2020

    @esd3v

    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.

  5. added
    feature-request
    on Apr 13, 2020
  6. khanakia commented on Apr 17, 2020

    @khanakia

    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.

  7. ehaynes99 commented on Apr 23, 2020

    @ehaynes99

    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.

  8. alexdima commented on Apr 28, 2020

    @alexdima
    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.

  9. added
    verification-needed
    on Apr 28, 2020
  10. mmghv commented on Apr 28, 2020

    @mmghv

    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?

  11. added
    verified
    and removed
    verification-needed
    on Apr 29, 2020
  12. aeschli commented on Apr 29, 2020

    @aeschli
    Contributor

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

  13. mmghv commented on Apr 29, 2020

    @mmghv

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

  14. alexdima commented on Apr 30, 2020

    @alexdima
    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.

  15. locked and limited conversation to collaborators on Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestundo-redoverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions