Sublime Forum

Help with sort lines problem

#1

Hi to everyone.
I am new to subl and accidentally press F9. When the text changed I totally panicked and close the program.
Later discover of the sort lines function. Tried to undo, but can’t. Now I have my master file ordered in a totally ordered-and-useful format.
What can I do, friends?

0 Likes

#2

correction: unuseful format.

0 Likes

#3

DId you save the file? If not, just revert. If you did … you better have some backups or VCS history, because once you close ST all edit history is lost.

0 Likes

#4

Thanks for your time Fichte. Unluckily (and trying to fix up the problem) later I saved with different encoding. Lesson learned for the future. Thanks!

0 Likes

#5

I also encountered this problem. Have you finally solved it? My text is all confused. How to restore it

0 Likes

#6

Sublime Text 4 restores your undo-stack, so unless you save the file and close it you should be able to simply undo.

0 Likes

#7

After pressing F9, I tried to undo, but the file didn’t respond. Because I was a novice, I tried to save the file and restart sublime, but the file couldn’t be recovered at all. How should I set text out of sorting

0 Likes

#8

As a general rule of thumb, if you do something that breaks your file, it’s not a good idea to save it to disk, and it’s definitely not a good idea to quit the program that did it.

You might have needed to undo more times, or use File > Revert File to reload from disk, discarding any changes. As noted above, if you’re using ST4 then quitting and restarting will restore undo, so long as you didn’t close the file, so you could still try that.

The advice from above still stands; if you save content of a file and then close it, unless you have an external backup of it or it’s in source control, the only way to restore the file back to what it was is to edit it manually.

2 Likes