Sublime Forum

Opening a file closes my current file

#1

Hello,

If I open a file by clicking on it in the file browser in the sidebar and do not make any changes to it and then try to open a second file, it opens in the same tab as the first file (i.e., the first file is no longer open).

The only way to open a file without losing the tab I currently have open is to make a trivial change in the first file before opening the second file.

Surely I am doing something wrong. Is anyone else experiencing this problem?

I am using sublime text 3 on fedora 23.

0 Likes

#2

That’s actually a feature called “preview on click”. There is a setting that controls it, which defaults to on:

// Preview file contents when clicking on a file in the side bar. Double
// clicking or editing the preview will open the file and assign it a tab.
"preview_on_click": true,

As the comment mentions, while this option is turned on a single click on a file in the side bar that’s not already open opens a tab with a preview of the file (you can tell this is the case because the text in the tab name is displayed italicized). Single clicking on other unopened files will swap the contents of the preview tab with the new file.

The two ways to commit the file to being opened in a permanent tab are to either modify the file (as you already noticed) or double click the name in the side bar instead of single clicking.

2 Likes

#3

Aha, thank you. Now that I have disabled the feature (it’s just not my cup of tea), I’m more comfortable.

A minor gripe: I wish I could still single-click to open files. Is this possible?

0 Likes

#4

Not that I’m aware of, no. I’ve seen a lot of people asking at various points in development but nobody has ever pointed out a way to enable such a feature if it currently exists.

0 Likes