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

Persist edit history after file closure #6534

Open
Xaelias opened this issue Nov 14, 2024 · 1 comment
Open

Persist edit history after file closure #6534

Xaelias opened this issue Nov 14, 2024 · 1 comment

Comments

@Xaelias
Copy link

Xaelias commented Nov 14, 2024

Problem description

I just lost hours of work because I tried to use a Sublime Text feature that errored out and replaced the whole content of the file by an error message. I stupidly thought it was a new window (like the result of a search), and closed it. Triggering an automatic save because I have save_on_focus_lost set to true.

Reopened the file and tried to revert the change but of course at that point it's too late.

Preferred solution

It would be a very useful feature if like many other text editors or IDEs on the market, ST would be able to persist the change history even after a file is closed. At the very least while the ST is not closed. This could of course be something that could be left off by default if people are concerned about performances on larger projects.

Alternatives

The only other thing that would have saved me here (besides disabling save_on_focus_lost), would be a confirmation box for the save / close because the change was massive (several hundred lines to 1). But this really isn't a valid solution here IMO.

Additional Information

For me, this is quite literally THE biggest feature I'm missing from ST today. When you work on a big project, you often open files, close them, make changes... Re-opening a file and wanting to revert changes is something we've all wanted to do at some point.

PS: I tried searching current and historical issues and couldn't find this specific feature request. Apologies if I missed it.

@Xaelias Xaelias changed the title Persis edit history after file closure Persist edit history after file closure Nov 14, 2024
@deathaxe
Copy link
Collaborator

ST actually persists undo history in its session_file (or project/workspace) - at least if hot_exit is enabled (which it is by default).

If a single file however is opened in a separate window which has no project/workspace assigned, there's no location to store any information to. Thus closing the window deletes all associated information/data.

It doesn't make sense to track all possibly opened files from any location as it is unclear whether they will ever be opened again or remain on there location etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants