Sublime Forum

All modified "contents" are set to empty (can I recover?)

#1

Hi,

I am using Sublime Text 3 since a couple of time (I am on Windows 7 for the record). I had Sublime on my “to try” list for other purpose, but it actually was a miracle to me because it gave me a tabbed text editor as slick as browser like Chrome, and mostly it was auto-saving everything, including unsaved files. So no more a computer crash would make me lose my multiple todo list or notes or whatever (and I like to take a lot). Losing everything is like a big cleanup, but really, it is losing important info, works, etc.

Only for what was mentionned up, it was a miracle, but of course, after playing with it, I also came to like it for multiple reason as you also do.

That being say, it was fantastic… until this week-end. It lost all the content of any edited tabs. I wished it was a temporary display bug, so today I closed everything and done a fresh restart of the computer, restarted Sublime, only to find that all my tabs were there, but their content gone.

So I did research to know where it was storing this and as far as I understand:

-  It save all the windows and tabs configuration, along with all unsaved changes in 

\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session, precisely in variable windows.buffers
[list]
*] If a file is saved, then it only keep a reference to the file

  • If we modify the content of a saved file, it keep the modified content and a reference to the file

  • If it is an unsaved tab, then it keep the content and there is no reference to a file

/*:m][/list:u]

So now, if I understood well that is where the truth about my session lie… what happened is that ALL my “contents” are now “contents”: “” – empty. So I basicelly lost everything.

It happen at a wrong time as usual, but since I use Sublime, let’s say I have been less on my guard because it was just working so well AND I did crazy test like opening hundreds of windows, open and close fast, etc. It seemed to be all smooth.

My observation for this week-end:

  • Sublime seem to have closed unexpectedly (or I did an exit without knowing, and no, I have no prompt when closing, I configured it to be like Chrome but for text editor)

  • I use multiple desktop (4 virtual desktop) and I opened a new text file which launched my 40 or so Sublime windows with lot of tabs, etc. — but I did it in the wrong desktop, and it was gonna pollute my screen, and I did an file->exit fast in Sublime – I DO NOT KNOW IF empty content was there before or after this, but if it is after this, an hypothesis is that it did not load correctly the content or did not have time to, and then saved the content that was loaded (empty here), but I don’t know if that is “possible” (developer of Sublime would know if they load windows and tabs, then after they load the contents. But if tabs + content is loaded at the same time, then I do not see a reason this would happen, except memory or OS issue, etc.

  • Next time I re-opened however, I noticed couple of blank tabs/Windows. I thought it was only new text I fired up, closed 2-3, then found out all my tabs were blank, except some saved files. But saved files that I modified in sublime were also blank.

That is a pretty scary bug. You can say “you cannot trust anything”, of course, but the tools should also be pretty safe in this regard. Information I put there are info I do not want to lose. Lot of info.

Take note that I was not in any project/workspace I think, but I will read about this after, it was not really in my need.

All this being said… have I lost all my contents or there is a backup somewhere, or old versions/undo log, etc.?

I wish there is. But if not, then Sublime is not as Sublime as I wish, but still it is the best solution I have and I do love the text editor, I did not mind some crash because the data seemed safe… is it a know bug (e.g., I can tell that for MySQL Workbench, which is not that bad tools compared to other but a POS for some details like auto-saving, because if you open the editor, it delete autosave file, and it only autosave each 1 minute… so you guess it, if you close below the autosave time… you lose everything – little details, but very important when you are a developer – I wish this is not what my fantastic Sublime is… it was working so well and saved me multiple times…).

I do not want to need to be paranoiacs everywhere, I want to be paranoiac once, configure well and then the rest is done transparently. I cannot rely on myself to be disciplined, do backup always, etc. (but if automated yes) – I cannot trust human, not even myself for that. I am lazy too, I do not want to stress or think about having to save everything, etc. (yeah, I can discipline myself of course and save all unsaved each day or each week or even do a backup of Sublime session, but you probably get it, that is a repetitive problem I do not want to worry about, it should be safe, that is it)

Anyway, if I did lost everything… then wow… major cleanup… but if you have suggestion (external backup program, Sublime plugins, Sublime magic settings, etc.) – I am all there to listen too. I want the contents I put in it to be extremely safe.

Thanks

0 Likes

How to make Sublime more safe
#2

BTW, maybe there is a way to reproduce there. But like my story, someone talked about a crash and then empty “contents” after:

“I also got used to this. Then I opened a file that just so happens to crash every text editor I’ve tried (register.js? why idk - github.com/jashkenas/coffee-scr … egister.js) and now I have 6 untitled empty tabs and 1 titled but unsaved and empty tab. in %AppData%\Sublime Text 3\Local there is Session.sublime_session, but all the files have “contents”: “”… which makes sense, I guess… :frowning:((”
source: sublimetext.userecho.com/topic/1 … ved-files/

0 Likes