Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restored unsaved buffer is erased by Undo #21846

Closed
1 task done
injust opened this issue Dec 11, 2024 · 0 comments · Fixed by #25106
Closed
1 task done

Restored unsaved buffer is erased by Undo #21846

injust opened this issue Dec 11, 2024 · 0 comments · Fixed by #25106
Assignees
Labels
serialization Restoration of the editor state after a restart workspace Feedback for workspace management, layout, interactions, etc

Comments

@injust
Copy link
Contributor

injust commented Dec 11, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

#13546 added the functionality of restoring unsaved buffers on restart.

Undo history is lost, which is expected. However, if you press Undo, the entire buffer is erased.

This is a bit of a footgun, as it is easy to accidentally erase the entire buffer and then overwrite the redo (e.g. by typing any character).

The more correct behaviour is for Undo to be a no-op in this situation, which is what VS Code does.

This would be fixed by #15097.

Environment

Zed: v0.164.2 (Zed)
OS: macOS 15.1.1
Memory: 16 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

@injust injust added admin read bug [core label] labels Dec 11, 2024
@JosephTLyons JosephTLyons added workspace Feedback for workspace management, layout, interactions, etc serialization Restoration of the editor state after a restart and removed triage labels Jan 2, 2025
@notpeter notpeter removed the bug [core label] label Feb 14, 2025
@osiewicz osiewicz self-assigned this Feb 18, 2025
osiewicz added a commit that referenced this issue Feb 18, 2025
…on (#25106)

Closes #21846

Release Notes:

- Fixed a bug that made it possible to undo changes in dirty
deserialized buffer (with `restore_unsaved_buffers: true`)
osiewicz added a commit to RemcoSmitsDev/zed that referenced this issue Feb 19, 2025
…on (zed-industries#25106)

Closes zed-industries#21846

Release Notes:

- Fixed a bug that made it possible to undo changes in dirty
deserialized buffer (with `restore_unsaved_buffers: true`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
serialization Restoration of the editor state after a restart workspace Feedback for workspace management, layout, interactions, etc
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants