Home Download Buy Blog Forum Support

Save and Reopen Untitled Tabs

Save and Reopen Untitled Tabs

Postby ajpalkovic on Thu Jun 16, 2011 1:55 am

See the replies in this thread before using.

Another day another plugin: https://gist.github.com/1028532

The inspiration for this one comes from E. In E, I could open a tab, jot some notes down and never save the tab. If I closed the editor and opened it again, E would also that tab I never saved. It was awesome and I missed that feature in sublime.

So, this plugin periodically saves any tab that has never been saved to the filesystem, to the Packages/User/UntitledFiles directory. When you reopen sublime, it opens a new tab for each of them and fills in the content.
Last edited by ajpalkovic on Fri Jun 17, 2011 1:16 am, edited 1 time in total.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Save and Reopen Untitled Tabs

Postby jps on Thu Jun 16, 2011 3:55 am

Sublime Text will do this out of the box is if you use "File/Hot Exit", rather than exiting normally.
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: Save and Reopen Untitled Tabs

Postby ajpalkovic on Thu Jun 16, 2011 4:17 am

O nice, I had no clue. Is it possible to make Hot Exit the default behavior (so that hitting the Red close button does a Hot Exit)?
Also, one slight difference is if sublime crashes or is forcibly closed, I lose the unsaved files. With the plugin it saves them somewhat quickly after modifying them.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Save and Reopen Untitled Tabs

Postby jps on Thu Jun 16, 2011 4:33 am

New files, as well as unsaved changes to existing files, will be periodically saved in the autosave session and restored at startup if the application wasn't exited cleanly. The autosave interval is 30 seconds. Also, when switching projects, your unsaved files and changes will be recorded in the project, so you can have scratch files per project.

I'd like to make hot exit the default, but the semantics don't appear clear on windows and linux where the application is exited by closing the last window. Doing a hot exit when closing the last window would imply that you'd get a 'Do you want to save...' prompt when closing a window other than the last one, but no such prompt when closing the last window.

I'm not entirely happy with the disconnect, but given the number of requests to have hot exit be the default, it may be worthwhile doing anyway.
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: Save and Reopen Untitled Tabs

Postby iamntz on Thu Jun 16, 2011 4:36 am

If the discussion is about files and other editors, there is any way of doing the undo steps to work beyond file close? I mean if I reopen a file, I would like to be able to undo any changes i did before, for last... let's say X days.

Thanks!

This is one of the feature I miss most. The other one is undo tree. :D
iamntz
 
Posts: 818
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Save and Reopen Untitled Tabs

Postby ajpalkovic on Thu Jun 16, 2011 5:08 am

Well, you don't necessarily have to make it the default, maybe just expose a setting so that individual people can make it their default.

I swear I tried testing if sublime autosaves changes, I guess I didn't wait long enough. O well. If I could just make HotExit the default, it would completely eliminate the need for this plugin. I'm not overly worried about the thing you brought up, I rarely open more than one window.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 9 guests