Home Download Buy Blog Forum Support

Not understanding New Window

Not understanding New Window

Postby mhughes on Mon Aug 26, 2013 11:03 pm

Using Sublime 3, I have a single window open for a project. When I open new window, I don't appear to be associated with any project. That's fine. But then, while I'm in the new window, I should be able to open the same project that I have open in the first window.

Similarly, I start with a single window with a project open. I drag one of the tabs out to be its own window. Shouldn't this newly created window still be part of the original project? Yet, when I try and Go To File with this new window in focus, I only see one file in the search results.

Am I missing the workaround here? Is this the expected behavior? I want the new window to just be a new view into the project; just like a new tab is.
Posts: 2
Joined: Mon Aug 26, 2013 11:00 pm

Re: Not understanding New Window

Postby adzenith on Tue Aug 27, 2013 2:31 am

This is unexpected behaviour, in my opinion, and there is no workaround that I know of, other than creating two duplicate projects.
Posts: 1403
Joined: Mon Oct 19, 2009 9:12 pm

Re: Not understanding New Window

Postby jbjornson on Tue Aug 27, 2013 7:46 am

..or maybe two workspaces for the same project?
Posts: 359
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Not understanding New Window

Postby qgates on Tue Aug 27, 2013 5:36 pm

I've found this annoying at times.

As I understand it, Sublime's workflow is presently project-per-window. Sublime remembers everything about the window workspace for the project automatically. Trying to open the same project in multiple windows contradicts the paradigm, hence the problem.

I actually *like* the project-per-window approach, and I love how sublime handles everything seamlessly: when you close the window, the project's state and workspace is saved out automatically. This rocks.

However, there's room for improvement, especially in the case where several windows are used to spread code across multi monitors. The simplest approach would simply be a "new window with current folders": the new window's not part of the project but functionally you'd get about 70% of the benefit (go to anything, search open folders etc.).

A more powerful approach would be to support multi-window projects: the sidebar would be mirrored for all windows part of the project, and "Groups" (panes) would now appear under "Windows". Files could be easily moved between groups or windows using the sidebar or the current drag and drop approach, but "Groups" could also be dragged between windows. Windows that are part of the project are saved when the project is closed.

For now I've adapted to the restriction: I have my main "project window" whose state and workspace I want saved, and auxilliary windows for my current work session. At the end of my work, anything important in those windows I drag over to my main project window before shutting sublime down - and everything else can be discarded.

Posts: 277
Joined: Mon Nov 05, 2012 4:33 pm

Re: Not understanding New Window

Postby Stubblechunks on Wed Aug 28, 2013 3:02 pm

I just gave up and adapted to using a couple of panes within the project window for the situation of dragging between open files.

I use cmd-P to re-open files within the project, and Advanced New File to create a new file within the project, and just never leave many files open, since re-opening them with cmd-P is pretty darned fast.

Typically, if I want to create a file OUTSIDE the project, I'm launching ST3 from the command line. But yeah, that part could be smoothed out a little.
Posts: 24
Joined: Wed Apr 24, 2013 8:35 pm

Re: Not understanding New Window

Postby mhughes on Wed Sep 11, 2013 4:34 pm

*If* you have your current session saved as a project, you can just use the "New Workspace for Project" menu item. That does mostly what I want.

However, if you launch Sublime like I do most often using subl <folder> from command line, you don't actually have a project. You just have a bunch of folders in the workspace.

So to try and solidify my understanding:
- Workspace = currently open folders in a given window?
- Project = saved Workspace?

So this could be solved a couple ways:

- I could also open a project instead of a workspace. Then "New Workspace for Project" would work as I wished.
- A new action "New Window for Workspace" could be added that duplicates my workspace (set of open folders) in a new window
- When dragging tabs from current workspace into a new window, the new window should inherit my workspace.

Last one would most certainly require change in Sublime. Second one could probably be addressed in a plugin, but I'd have to dig into the API.
Posts: 2
Joined: Mon Aug 26, 2013 11:00 pm

Re: Not understanding New Window

Postby GrantSP on Thu Sep 12, 2013 4:59 am

This is interesting, at least for the project I am working on.

So what exactly is the difference, as far as Sublime is concerned, with the following scenarios:

A project with 2 files open in a single column layout - top file in current buffer and bottom file in previous buffer
A project with 2 files open in a 2 column layout - with either file in the current buffer and the other in the previous
A project with 2 files open and one file is dragged out to make a new window
A project with 2 files open, one in the original window and the other in the window from the "New Workspace for Project" command?

There must be some underlying difference in the way the main program views each of these scenarios, otherwise there would be no difference in the way they are handled.
But what is that difference?
I'm currently porting to version 3 the WinMerge plugin, and previously the 2 last buffered files, whether in a single/double layout or 2 windows, were parsed as the criteria to start the WinMerge comparison. But if the ability to change the internal recognition of each view is available, that would be helpful to know.

Or is this all just to do with how the project is handled?
I would like to know either way.
Posts: 39
Joined: Sat Aug 31, 2013 5:11 am

Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests