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
{{ message }}
Repository navigation
Keep undo stack between file close and reopen #7169
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)?
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
Reacted by A. J. Vargas, Mohamed Gharib and Esteban Hernández
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.
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.
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
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.
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.
Reacted by Yurii Holskyi, meboev, Mohamed Gharib, Andrej Pavlovic, Hai Feng Kao, Dorival Pedroso and Esteban Hernández
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.
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. 😢😭
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
Activity
joaomoreno commentedon Jun 3, 2016
Fixed recently.
bpasero commentedon Jun 3, 2016
Fixed in latest. Maybe you are still using this?
joaomoreno commentedon Jun 10, 2016
Updated original steps.
bpasero commentedon Jun 10, 2016
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.
alexdima commentedon Jun 29, 2016
We have the content hash now, but not a serializable undo/redo stack
alexdima commentedon Jun 29, 2016
IMHO this should go on the plan rather than me doing it under the radar. João Moreno (@joaomoreno) you can lobby for it
23 remaining items
meboev commentedon Apr 9, 2020
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
sfilipov commentedon Apr 9, 2020
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
meboev commentedon Apr 9, 2020
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.
charrondev commentedon Apr 9, 2020
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.
phil294 commentedon Apr 9, 2020
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
aj-vargas commentedon Apr 10, 2020
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.
And even
vimsupports disabling persistent undo :)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
⌘+Zand 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⌘+Zon 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.
hd-esteban commentedon Apr 24, 2020
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.
dkolba commentedon Apr 27, 2020
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. 😢😭
anstosa commentedon Apr 27, 2020
Duncan Kolba (@dkolba) It's closed because they added it in the March update
dkolba commentedon Apr 28, 2020
Ansel Santosa (@anstosa) only if you didn't close VSCode in between edits (which completely defeats the purpose tbh).
anstosa commentedon Apr 28, 2020
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