Sublime Forum

Disable saving session of a file after closing sublime text 4

#1

I am using sublime text 4 ( recently released Version 4 ). BUT I am having a problem in permanently saving the file after close.

This problem was not in the sublime text 3.

What is the Problem ?

When i make changes in the file and save it and close sublime text then Reopen again and press Ctrl + Z then it it undoing the changes that i have made, BUT i want it NOT to undo the changes after close the file or close the sublime text.

In sublime text 3, Whenever i make changes then close the file then it never undo the changes ( which is good ) BUT this is the problem in the sublime text 4

I have also tried searching many times BUT i didn’t find any solution.

I know This is because in Sublime Text 4 (specifically from Build 4075 onwards), the undo history is stored in the session file (either the global session file if the current window is not associated with a project or the workspace file if it is). Sublime Text 3 did not have this ability.

Since the undo stack is stored in session, whenever i do some kind of edits on a file and exit the app, the undo continues to work for that file even after i open the app.

Thank You in Advance

0 Likes

#2

Why do you want to disable this feature? If you accidentally undo something it’s trivial to redo it, and the undo history has only a small impact on memory/disk usage.

0 Likes

#3

@bschaaf I want sublime text to save permanently after close, Because sometimes when i make some changes and close it then again make changes second time ( which syntax gone wrong ) then i could’ve successfully undo the last changes in previous changes BUT with this new update, when something goes wrong after second changes and if i try to undo it then fisrt changes also undo all. That’s why i deleted sublime text.

0 Likes

#4

Sorry I don’t follow. The saved undo history is purely in addition to any extra changes you make, it shouldn’t override anything or interfere in any way other than having extra history you didn’t have before.

0 Likes

#5

Instead of using Undo All, try using File -> Revert File (down near the bottom). It will revert all your changes back to the last saved state, but no further.

0 Likes