vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Keep undo stack between file close and reopen

Open joaomoreno opened this issue 10 years ago • 28 comments

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

Undo stack is lost 😢

joaomoreno avatar Jun 03 '16 07:06 joaomoreno

Fixed recently.

joaomoreno avatar Jun 03 '16 07:06 joaomoreno

Fixed in latest. Maybe you are still using this?

image

bpasero avatar Jun 03 '16 07:06 bpasero

Updated original steps.

joaomoreno avatar Jun 10 '16 07:06 joaomoreno

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.

bpasero avatar Jun 10 '16 07:06 bpasero

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

alexdima avatar Jun 29 '16 19:06 alexdima

IMHO this should go on the plan rather than me doing it under the radar. @joaomoreno you can lobby for it

alexdima avatar Jun 29 '16 19:06 alexdima

See also https://github.com/Microsoft/vscode/issues/10932

bpasero avatar Aug 26 '16 10:08 bpasero

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.

stevensacks avatar Oct 27 '17 17:10 stevensacks

Also broken in Insiders: Version 1.18.0-insider.

stevensacks avatar Oct 27 '17 17:10 stevensacks

I confirm broken in version 1.18.1, also on version 1.19.0-insider

igolskyi avatar Nov 19 '17 22:11 igolskyi

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

skylarmb avatar Oct 18 '18 22:10 skylarmb

There are bugs like this one that leave vs code feeling quite unfinished as an overall product.

kr094 avatar May 23 '19 18:05 kr094

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.

phil294 avatar Jul 26 '19 15:07 phil294

is there any update to this issue?

aloey avatar Feb 01 '20 06:02 aloey

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.

charrondev avatar Feb 24 '20 17:02 charrondev

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

skylarmb avatar Feb 27 '20 19:02 skylarmb

I am also missing this feature.

The undo history is also lost when renaming a file, even if it's open.

silllli avatar Mar 04 '20 11:03 silllli

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

meboev avatar Apr 09 '20 10:04 meboev

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

sfilipov avatar Apr 09 '20 11:04 sfilipov

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.

meboev avatar Apr 09 '20 19:04 meboev