Sublime Forum

Bug? two windows open, only one restarted

#1

windows 11, stable channel 4189

i believe i inadvertently closed down my main window (window 1) of documents, complete with specific origami layout, not realising another instance/window (window 2) was still open.

when i noticed THAT, i closed window 2.

now, the only window that comes up on restart is window 2, which is entirely useless, as it was used for scratch / temporary documents only.

while i know all the important files are fine, is there a backup history of the window layout (complete with origami settings, if possible) i can revert to, or do i need to rebuild the layout from scratch? which, of course, means i’ll need to remember which files were open, where they were, etc… not life-threatening, but an annoying amount of time better spent elsewhere.

thanks.

0 Likes

#2

Unless you used a project file, which separately save your window data, no there’s no way to restore that.

1 Like

#3

thanks. i guess it’s what i expected, but hoped against hope.

i may have to uninstall and reinstall here. what little i changed last night changed once again this morning. not sure what’s going on, but i’m not used to being fooled by instability with ST…

0 Likes

#4

I’ve gotten caught by this more than once. There are two ways as I’m aware to ensure that you don’t lose it:

  1. Always have a new unsaved document in your main window that you want to keep (which will result in a confirmation dialogue if you accidentally close it first), or
  2. Save your main window as a project as well. (and then if you close it first you can use switch project to get back to it).

I’m using option 2 for the moment (saved as a project in Documents)

0 Likes

#5

Blockquote I’m using option 2 for the moment (saved as a project in Documents)

fwiw, i’ve started saving to projects and workspaces. noticed, though, the project file contains a single json definition, with nothing inside.

{
“folders”:
[
],
}

the workspace seems to have everything within that i’d expect, though i’m not 100% sure about the origami file/tab positions… those i can fix in a few minutes…

is an “empty” project file expected after project save, or is something else going on behind the scenes i don’t know about?

0 Likes

#6

@travelgirl

Yes, the almost-empty .sublime-project file is correct. Everything else (tabs, layout, undo history, file history, command history, autocomplete history etc) is in the .sublime-workspace file. It is split up that way so that the project file is ok to be checked into version control. Sublime’s docs for projects are here: sublimetext.com/docs/projects.html

Most projects that I have are only the following in the .sublime-project file. (the folders key is a list of the folders that are shown on the sidebar)

{
    "folders":
    [
        {
            "path": ".",
        }
    ],
}
0 Likes

#7

Blockquote
Most projects that I have are only the following in the .sublime-project file. (the folders key is a list of the folders that are shown on the sidebar)

does this mean that saving to the project file is all i need to do, that the workspace file is generated automatically? i’ve been saving both at the same time… if saving project also saves workspace, i can stop doing the two-step… thanks :slight_smile:

0 Likes

#8

Yes. that is correct. The workspace file is generated automatically once you save the project.

0 Likes

#9

strange, but thank you for the clarification :slight_smile: it is appreciated…

0 Likes

#10

Why strange? It is the file your unsaved content is stored to.

0 Likes

#11

Here is the related topic:

0 Likes