Home Download Buy Blog Forum Support

Layouts and others...

Re: Layouts and others...

Postby tgkeul on Tue Jun 09, 2009 7:03 pm

Sessions differ from projects.
When I'm working on a project with maybe 100 files I like to group some files in sessions to represent a certain aspect. Some of these correspond to bug tracks, some to business objects and their environment.

I used this feature a lot with multiedit years ago and missed it a lot. I had some Ideas to realize it myself but didn't make it.

I suggest to use the sublime-session and allow the user to save the file with a name of his choice. We only need a save and a load command in the menu.
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: Layouts and others...

Postby jps on Wed Jun 10, 2009 9:39 am

Insert key is on the todo list - it hasn't been a high priority, but as with anything else, if people want it more than I realise, I'll move it up the list.

re: sessions. Sessions currently contain a snapshot of all state: currently opened windows and their positions, as well as files opened within the windows, recently opened files, find history, etc. It would seem that not all of this is appropriate to serialise/restore if exposing the ability to load/save sessions: it likely doesn't make sense to reposition the windows, for instance.

What should happen to currently opened files if you choose to load a session - are they closed, or do they remain open? What about new files that have been created but not yet saved?
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Layouts and others...

Postby vim on Wed Jun 10, 2009 10:00 am

What should happen to currently opened files if you choose to load a session - are they closed, or do they remain open? What about new files that have been created but not yet saved?


imo, the editor should never cause the user to loose his work, unless instructed so explicitly. so regarding new files or unsaved changes i think you must keep them open. if this is generalized, why closing any open file or window? it can be decided that loading a session will open new windows, i.e. we can see the current open windows/files as a new, temporary, session, and the loaded session as another. if we take this further, we now need to decide if this should be handled as a third session, or is it still 2 sessions (side by side). i would go with the simplest solution, seeing it as a new (3rd) session, so if saved, will contain all the windows/files/etc. states.

vim.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Layouts and others...

Postby jps on Wed Jun 10, 2009 11:49 am

I can see a few options for how it could work, none of which would result is the user losing any work:

#1: Changing sessions is like changing profiles: sessions contain the complete state of the editor (open files and their modifications, as well as open windows and their positions), and changing session will close all open files and switch entirely to the new one. This would work behind the scenes just like 'File/Exit and preserve session': state, such as unsaved changes to open files, would be saved in the session.

#2: Sessions apply to a window at a time only. Opening a new session will open a new window with that session. It allows multiple sessions to be open at the same time, but perhaps doesn't make sense if you want one session to span multiple windows.

#3: Making sessions a bit 'softer': Opening a session closes all opened but un-modified files, while leaving modified files alone. Files that were open in the session are then opened. Window state, layout, find history etc aren't touched.

I think #3 is my favourite, but I'm not sure that any of the above are really satisfying.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Layouts and others...

Postby EJ12N on Wed Jun 10, 2009 2:06 pm

jps wrote:I can see a few options for how it could work, none of which would result is the user losing any work:

#1: Changing sessions is like changing profiles: sessions contain the complete state of the editor (open files and their modifications, as well as open windows and their positions), and changing session will close all open files and switch entirely to the new one. This would work behind the scenes just like 'File/Exit and preserve session': state, such as unsaved changes to open files, would be saved in the session.

#2: Sessions apply to a window at a time only. Opening a new session will open a new window with that session. It allows multiple sessions to be open at the same time, but perhaps doesn't make sense if you want one session to span multiple windows.

#3: Making sessions a bit 'softer': Opening a session closes all opened but un-modified files, while leaving modified files alone. Files that were open in the session are then opened. Window state, layout, find history etc aren't touched.

I think #3 is my favourite, but I'm not sure that any of the above are really satisfying.


I like #1, just like we have right now "exit and preserve session", so +1 for #1!

This little feature has saved me a couple times already, I love the fact it saves unsaved files!
Sometimes I am recompiling information or just doing budgeting or quick notes whatever, I am glad sublime saves unsaved buffers which are (unexpected) shutdown/reboot friendly :D
I feel safe using sublime text, I know my stuff is always going to be there! lol :D
EJ12N
 
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: Layouts and others...

Postby gpfsmurf on Wed Jun 10, 2009 4:56 pm

I vote for #3, and the addition of a simple "Open session in new window" or something like that.
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: Layouts and others...

Postby EJ12N on Wed Jun 10, 2009 6:20 pm

sublimator wrote:EJ12N: Check out Steve's AutomaticBackups plugin if you haven't already. Really handy.

Yes I am aware of the plugin, very handy, but I just like the option to be able to have *unsaved* files "saved" in the session, without having an "individual file" saved on disk for that buffer.
(I know the thing is saved on disk in session files [Auto Save Session.sublime-session, Session.sublime-session]), but this is automagically saved for me.
EJ12N
 
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: Layouts and others...

Postby jps on Wed Jun 10, 2009 10:48 pm

EJ12N wrote:This little feature has saved me a couple times already, I love the fact it saves unsaved files!


If I'm allowed to have favourite features, this would be one of them - I've got unsaved files with notes etc that I started editing months ago, and have yet to get around to explicitly saving them.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Layouts and others...

Postby EJ12N on Thu Jun 11, 2009 3:06 pm

sublimator wrote:EJ12N: Yeah, they are complementary. The auto backup saves a time stamped version of each save, kind of like an automatic commit for a rudimentary version control. Works quite well. Has ctrl+alt+[ or ] to rewind/fast forward through history.

Nice, I might give it a go very soon :D

jps wrote:If I'm allowed to have favourite features, this would be one of them - I've got unsaved files with notes etc that I started editing months ago, and have yet to get around to explicitly saving them.

Yup exactly my point! I got some unsaved files there too with phone numbers and quick notes that been sitting for months :D
EJ12N
 
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: Layouts and others...

Postby tgkeul on Thu Jun 11, 2009 4:03 pm

Just an idea.

I would like to abondon the save command. Changes should always be saved immediatly without confirmation and the undo stack too.

Today, changes cannot be made undone after the file was saved and closed. On reopening all undo information is lost.
If the undo stack will be saved changes may then get undone when reopening the file.


Comming back to sessions, I vote for #1.
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

PreviousNext

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 9 guests