Skip to content

Keep undo stack between file close and reopen #7169

Closed

Description

  • Make a change in a file
  • Close it Ctrl W
  • Open it again Ctrl Shift T

Undo stack is lost 😢

Activity

  1. added
    bug
    important
    on Jun 3, 2016
  2. joaomoreno commented on Jun 3, 2016

    @joaomoreno
    ContributorAuthor

    Fixed recently.

  3. bpasero commented on Jun 3, 2016

    @bpasero
    Contributor

    Fixed in latest. Maybe you are still using this?

    image

  4. joaomoreno commented on Jun 10, 2016

    @joaomoreno
    ContributorAuthor

    Updated original steps.

  5. bpasero commented on Jun 10, 2016

    @bpasero
    Contributor

    We dispose the editor when you close it and this means we get rid of the undo stack. This needs support from the editor to store the undo stack with the editor and resource (maybe similar to storing the view state)?

    alexandrudima moving to you.

  6. added
    feature-request
    on Jun 29, 2016
  7. alexdima commented on Jun 29, 2016

    @alexdima
    Member

    We have the content hash now, but not a serializable undo/redo stack

  8. alexdima commented on Jun 29, 2016

    @alexdima
    Member

    IMHO this should go on the plan rather than me doing it under the radar. João Moreno (@joaomoreno) you can lobby for it

  9. 23 remaining items

  10. meboev commented on Apr 9, 2020

    @meboev

    Oh God, please make this optional, default "on" if you want, but put an option that I can turn off. Some people like me, like to ditch the undo/redo history this way! You know, open the file clean, no undo history, etc. Existence of this feature is the main reason I hate Web Storm, and prefer VS Code, and now you are making this default here also! OMG

  11. sfilipov commented on Apr 9, 2020

    @sfilipov

    Apologies for the off topic, and no disrespect to meboev comment, but it reminded me of the following XKCD and it needs to be mentioned:

    Workflow

  12. meboev commented on Apr 9, 2020

    @meboev

    About the XKCD analogy... The funny thing is that it's more like the other way around. Something like, you have just fixed a bug for people with a non-working "Control + w" on their keyboard, with a permanent, non opt-out binding of the "Spacebar" anywhere in the app, interpreting its single press with a rapidly heating the CPU, making your OS freeze, thus closing the currently opened files with a hardware reboot.

  13. charrondev commented on Apr 9, 2020

    @charrondev

    Oh God, please make this optional, default "on" if you want, but put an option that I can turn off. Some people like me, like to ditch the undo/redo history this way! You know, open the file clean, no undo history, etc. Existence of this feature is the main reason I hate Web Storm, and prefer VS Code, and now you are making this default here also! OMG

    I view it as, I like to keep a clean list of open editors, rather than a clean undo history. The open editors (or tabs if you configure that way) are visual. The undo history is not.

    I'll also note that unlike webstorm, VSCode is open source and accepts community contributions so if a configuration option isn't present you can implement one.

  14. phil294 commented on Apr 9, 2020

    @phil294

    Oh God, please make this optional, default "on" if you want, but put an option that I can turn off. Some people like me, like to ditch the undo/redo history this way! You know, open the file clean, no undo history, etc. Existence of this feature is the main reason I hate Web Storm, and prefer VS Code, and now you are making this default here also! OMG

    Not trying to invalidate your point, but could you please explain what you need to ditch the undo history for? Is it so that you can spam "undo" without worrying about going back further than desired?

    It seems that now that this issue got closed, your best bet is probably to open up a new one. Either way you have a point, since making new features configurable is rarely a bad idea

  15. aj-vargas commented on Apr 10, 2020

    @aj-vargas

    Reading the comments of past years I see how useful this new feature is for some. I always saw the bug more like a feature over WebStorm though hehe.

    even vim supports this... you can close a buffer and re-open it and maintain your undo stack, or even quit vim entirely and re-open it in a different terminal and keep your undo history.

    set undodir=~/.vim/tmp/backup/
    set undofile
    

    And even vim supports disabling persistent undo :)

    Not trying to invalidate your point, but could you please explain what you need to ditch the undo history for? Is it so that you can spam "undo" without worrying about going back further than desired?

    It's my own specific case yes, to be able to spam "undo" without worries. When I close a tab in VSCode I mean to say "I'm closing this file" not "I'm hiding this file", hitting ⌘+Z and seeing the file contents change feels like I just hid it from the view (like Adam Charron (@charrondev) mentioned). When I have multiple VSCode windows open (and several tabs on each), hitting ⌘+Z on a file without seeing changes gives me the feel that the file (of all open files/tabs) hasn't been edited since open and it's clean.

    Not a dealbreaker for me tbh, but I agree with Philip Waritschlager (@phil294), it would be nice that these kind of features were configurable.

    Anyways, somebody opened the issue #94778 requesting a configurable persistent undo.

  16. hd-esteban commented on Apr 24, 2020

    @hd-esteban

    I also think it should be optional. In my case, if I close a file is because I already finished modifying it, so I don't need the history anymore. The next time I open that file I expect an empty undo/redo list, and now If change something and then I press ctrl + z by twice I can delete something or add something I wrote or deleted previously, so I my case now I need to be very careful while pressing ctrl + z, I need to check that several times to verify I didn't break anything. Also you need to think that for most of the cases people open and close their files several times while coding and this behavior could affect them as I explained, and only a very small percentage of cases would be the 'accidents' that they said. VSCode is a code editor, not a version tracker.

  17. dkolba commented on Apr 27, 2020

    @dkolba

    Coming from vim, I am astonished that no one is missing this feature?! Persistent undo stacks are great for rapid prototyping - kinda like a "git lite™️". Sad to see this issue closed. 😢😭

  18. anstosa commented on Apr 27, 2020

    @anstosa

    Duncan Kolba (@dkolba) It's closed because they added it in the March update

  19. dkolba commented on Apr 28, 2020

    @dkolba

    Ansel Santosa (@anstosa) only if you didn't close VSCode in between edits (which completely defeats the purpose tbh).

  20. anstosa commented on Apr 28, 2020

    @anstosa

    Duncan Kolba (@dkolba) agree that they should make it truly persistent, disagree that it defeats the purpose... I close files as part of my normal workflow and frequently want to go back to them. I never close VSCode as part of my normal workflow

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

Metadata

Metadata

Labels

editor-textbufferfeature-requeston-testplanundo-redo

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions