Redo buffer is cleared when saving a file #31021
Replies: 7 comments 3 replies
-
I thought this was just me doing something weird with the editor since I'm trying it out since a few days ago. Thanks for pointing this out. It is happening for me too (linux) |
Beta Was this translation helpful? Give feedback.
-
This is happening on macOS on Zed 0.186.9 as well |
Beta Was this translation helpful? Give feedback.
-
Thanks for reporting. This is caused by As a workaround, if you wish to be able to redo actions after save, you will need to disable I'm not sure how this behavior could be different without supporting a different non-linear undo/redo history, so I'm going to close this as unactionable. If you have ideas for how such a non-linear undo/redo history could work, please open a discussion to flesh that out further. The current behavior enables users to "undo" any changes introduced by formatting, any solution would need to support synthetically rewriting the redo steps so they could be applied to the post-formatting document state, not the pre-format document state as they were originally constructed. Not impossible, but certainly non-trivial and I can't imagine how you could do it without conflict and unintuitive behavior (e.g. redo before format and redo after format are different operations if the changes overlap). Thanks for reporting, but closing as unactionable. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
FWIW I am experiencing this issue with Remapping |
Beta Was this translation helpful? Give feedback.
-
I've added a feature request for this. |
Beta Was this translation helpful? Give feedback.
-
I just lost a day's work because of this. 😖 Definitely unexpected behavior. I can't help it if muscle memory makes me accidentally hit ⌘S while reviewing changes by browsing the undo stack. 😂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When undoing a change in a file and saving, the undone changes can no longer be redone. This is extremely frustrating because in addition to the UI not behaving as expected ("why is the redo history gone?!"), the file is saved in the process, so there is no way to retrieve the lost changes from disk either.
Description
An undo/redo system should always allow you to go back and forth between states, so long as you're not modifying the history in any way. Saving a file should act as a "modification" of the state. If undoing is possible after saving a file, then I also expect redo to work just aswell.
Steps to reproduce:
Expected Behavior: "hello world" should reappear in the text editor
Actual Behavior: the file remains empty. My "hello world" is lost forever.
Screencast_20250511_150812.webm
Zed Version and System Specs
Zed 0.184.9
Beta Was this translation helpful? Give feedback.
All reactions