Keep undo stack between file close and reopen
- Make a change in a file
- Close it Ctrl W
- Open it again Ctrl Shift T
Undo stack is lost 😢
Fixed recently.
Fixed in latest. Maybe you are still using this?

Updated original steps.
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.
We have the content hash now, but not a serializable undo/redo stack
IMHO this should go on the plan rather than me doing it under the radar. @joaomoreno you can lobby for it
See also https://github.com/Microsoft/vscode/issues/10932
This bug is back again. I'm using Version 1.17.2. This one bug makes VS Code almost unusable for me, since it's such a common part of my workflow.
Also broken in Insiders: Version 1.18.0-insider.
I confirm broken in version 1.18.1, also on version 1.19.0-insider
This is still an issue... cmd+w by accident, cmd+shift+t a split second later and all my edit history is gone. Infuriating. This has probably cost me hours of dev time over the last month...
There are bugs like this one that leave vs code feeling quite unfinished as an overall product.
Was this ever possible at all? I am seeing conflicting statements here.
Is this a bug or a feature request?
Also see https://github.com/Microsoft/vscode/issues/47874.
is there any update to this issue?
Confirmed this is still not working. I prefer VSCode to Webstorm in every aspect except for this. Webstorm will keep a long running local revision history, and VSCode can't even keep it for 5 seconds after closing a file.
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
I am also missing this feature.
The undo history is also lost when renaming a file, even if it's open.
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
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:
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.