Sublime Forum

Unable to save Column Layout in ST3

#1

Hi, I bought ST3 several months ago and I’ve been unable to use it as the column layouts are not saving.

In the meantime I’m still using ST2 so it’s not a biggie but it’s just a horrible user experience having to constantly re-create my two column editor.

Anyone else having this issue?

0 Likes

Defective OS X anonymous projects - broken layout, search history behaviour
#2

Is this the sort of support that is expected when you pay $90 for a text editor?

Seriously?

0 Likes

#3

Can’t confirm that issue on Windows. Layouts are saving correctly if "hot_exit" is true.

Closing the window by closing the tabs one after another causes ST to save a single view layout when finally closing.

0 Likes

#4

I’ve taken a look at the config, hot_exit is indeed defined to true.

When I’m editing a file with two columns, a file is generated called Auto Save Session.sublime_session - the file with the exact same contents are also saved when I close the window.

However, whenever I re-open it, it’s reverted to one column layout - and when I open a file - and thus re-saves the environment it, it becomes single column

This is completely different functionality to ST2.

EDIT: Look for cells

0 Likes

#5

No idea why your layout isn’t saving but if you really want a 2 column layout all the time, just create a new plugin (Tools -> Developer -> New Plugin…) with the following contents:

import sublime
import sublime_plugin

def plugin_loaded():
    sublime.active_window().run_command('set_layout', {"cells": [[0, 0, 1, 1], [1, 0, 2, 1]], "cols": [0.0, 0.5, 1.0], "rows": [0.0, 1.0]})
0 Likes

#6

In fact the layout must stay as it is. I can’t tell something about MacOS, but it works as expected on Windows and Linux (ST3156). It works for me with a project opened or not. Also renamed, my session, opened ST created two column layout with new unsaved buffers, closed ST and reopened. Layout is restored as expected.

Maybe a package, which forces a certain layout upon startup? Didn’t read the issue thoroughly, but did you try with vanilla setup (no package installed)?

0 Likes

#7

It’s as vanilla as can be; there is a modded ST2 installation on this machine but every time I have tested [ST3], I have started afresh.

0 Likes

#8

I think I have a way this can be replicated, and @deathaxe gave me an idea:

Closing the window by closing the tabs one after another causes ST to save a single view layout when finally closing.

It appears that is actually what I am experiencing.

So:

  • Right click on ST icon in Dock, Quit; click on icon in dock: keeps layout
  • Click ‘X’ icon on top left of ST window; click icon on dock: reverts to new layout
  • Close tabs one by one; ST automatically closes; click icon on dock: reverts to new layout

I have repeated these steps in ST2 and in all circumstances they are keeping layout.

I hope this helps!!

0 Likes

#9

Just to clarify, would it be correct to state that your issue is that whenever Sublime creates a new, empty window (i.e. with no files in it), it always defaults to a single pane, but if it is restoring a previous session (i.e. with some files still present), the layout remains?

0 Likes

#10

Also to clarify, in scenarios 2 and 3, you’re not actually quitting Sublime? The scenarios are as follows?

  1. Quit Sublime via the Dock icon. Reopen via the Dock icon.
  2. Close all windows via the title bar but do not quit. Click on the Sublime icon in the dock to open a new window.
  3. Close all tabs but do not quit. Click on the Sublime icon in the dock to open a new window.
0 Likes

#11

Yes, this is correct, to both @OdatNurd and @ThomSmith

0 Likes

#12

As a matter of semantic difference, I think your issue is not that Sublime isn’t saving your view layout, it’s that it’s not saving your view layout as a default layout. The distinction there is very light (and again just semantically different) and might be why you’re not getting many responses or why people think that they’re not experiencing the same problem as you (or can’t reproduce it).

The view layout of existing windows is persisted in the session file so that they can be restored at startup, but as far as I’m aware the default layout for a new window is a single pane/column and has been that way for at least as long as I’ve been using ST3 (roughly two years).

I would have guessed that there would already be an issue reported where someone was requesting the ability to set a default layout for new windows but a quick search didn’t turn up anything, although I didn’t dig too deeply.

It might be an idea to make this as a feature request, although if Sublime 2 had this feature and Sublime 3 doesn’t, it may have been dropped for some reason. In that case there may be reason for not adding it back.

All that said, as @kingkeith mentioned above it’s possible to create a plugin that will get you most of the way there. Here is a stack overflow link where someone wants something similar (two rows instead of two columns) and I there is a plugin in there that will do this in most cases.

The emphasis there is because the plugin works in two ways. First, when it is loaded (at Sublime startup) it forces a default layout on all of the windows that are currently set to a single pane. Secondly it tracks when the new_window command has just finished executing and applies the default layout to the new window.

This works nicely on Windows and Linux because on those operating systems closing the last Sublime window also has the effect of terminating Sublime. When you start Sublime again, any windows that it restores presumably have your default layout and are left alone, while if it doesn’t have anything to restore it creates a new window which will have the default applied, and then from this point forward newly created windows have the new default layout.

On MacOS it’s common for applications to remain running even when they have no visible windows, so on that OS when you close the last window Sublime remains running. At this point if you click on the dock icon it creates a new window automatically, but this doesn’t invoke the new_window command, so the plugin doesn’t know that you have a new window and does nothing.

So on that operating system and in that situation, you would need to do one of:

  • Manually change the layout of this new window (possibly with an extension to this plugin, which would be easy to add)
  • Create the first window by selecting New Window from the dock icon popup menu instead of clicking on the icon directly
  • Immediately create a new window with the keyboard shortcut, then close the original.

It’s also possible to change how the code works so that it could better detect new windows, but that would require constant polling of the window list to detect new windows, which due to performance concerns that plugin doesn’t currently do.

1 Like

#13

In addition to @kingkeith 's answer, you may simply install the plugin I have developed to ensure a 2-col layout.
It will work on new window instances as well.
It is super comfortable to use. Just install it and enjoy a TwoColumn layout always and automatically.

https://packagecontrol.io/packages/TwoColumns

In case you do desire a different layout just modify the code respectively by changing the regarding constant.

1 Like

#14

I could use a plugin, but, using a plugin to fix a regression is an awful way of doing things.

I e-mailed support to ask for either a fix for for a refund for the upgrade.

I will be more than happy to re-upgrade to ST3 once this has been fixed (as it’s a deal breaker imho), however for the moment I shall continue to enjoy the ever so delightful and reliable ST2 :slight_smile:

0 Likes

#15

@Westie can you update this when support replies? I have the same feelings about this and am curious what they say.

0 Likes

#16

They approved the refund but they couldn’t find my PayPal transaction; to be fair I have nearly sat on it for nearly two weeks because of Christmas and the sheer amount of e-mails I receive :expressionless:

0 Likes

#17

I’ll be honest, I am still disappointed that this isn’t fixed in build 3188, it’s been what, over two years since this was originally posted?

Since I’m using Windows more (gaming PC, woohoo) I’ve decided to re-upgrade to ST3 - and I took a punt at @PyBen’s plugin - and I’m chuffed to say that it worked. Just a bit apprehensive about having to rely on a plugin to fix it!

For @brayk1990 and other users, Sublime PTY refunded me the upgrade fee back in January 2018. I originally didn’t see it happening - it took me nearly a year to realise that I paid via card instead of PayPal, because reasons.

I think now is when I can finally lie ST2 to rest.

0 Likes