78

Sublime Text 2 stopped creating a new tab when opening a file from the sidebar.

The file I select opens in the current tab, but the tab doesn't even update the filename, it shows the old file but it's greyed out like a new tab should exist.

I disabled the few packages I have installed with no luck.

My custom user settings aren't much at all:

{
  "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
  "font_face": "Consolas",
  "font_size": 12,
  "font_options": "subpixel_antialias",
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "use_tab_stops": true,
  "fade_fold_buttons": false
}

Any ideas of what's happening? I can't seem to find anyone else having this issue.

I reverted to a freshly installed state by removing my data folder and I still do not get tabs when clicking on files from the sidebar in a project.

Solved! What an idiot. The single click is apparently just a preview of the file. Double-click actually opens the file in a new tab.

5
  • 2
    In my opinion this is by far the most annoying feature of Sublime Text 2. The preview looks like a loose file, that you can't even close with the mouse. More than that, it is left there hanging with no particular meaning. I'd love to be able to disable this. Is it possible? Commented Jul 14, 2012 at 18:37
  • 6
    +1 for an option to disable this Commented Jul 21, 2012 at 19:24
  • this got me too, damn you double click!!!! Commented Aug 24, 2012 at 16:29
  • 2
    This is actually a feature that I love in Sublime Text 2 and feel like they did it right. Far too often, I find myself browsing files without a need to edit them. In most other editors, this results in tab explosion because all I wanted to do was view files contents. I think that this subtle difference sets Sublime Text apart and is more often what developers want to happen versus popping up a tab for every file you open regardless if you need to edit it or not. Commented Oct 3, 2012 at 17:09
  • 1
    @Lo-Tan, I agree completely. In fact, I've now got so used to Find Anything (ctrl+p) that I really wish there was an option to only open a file's tab if you tab out of that file without saving. That way, I could teleport around files making changes without having massive tab bloat. I end up right-clicking the tab title and going "Close Others" a lot. Commented Apr 19, 2013 at 5:42

10 Answers 10

123

Ironically, this is a feature and not a bug. Sublime Text 2 calls it a preview. You are presented with the contents of a file without actually opening the file. This is a confusing concept for new users but is certainly helpful. A tab for the preview should appear as soon as you begin editing the file or when you double-click on the file in the sidebar.

This has been discussed more in depth on the ST forum in "2 OS X Bugs".

Personally, I believe this should be more clear. I've proposed some additions to the preview feature that can be found in "I Present To You: The Sublime Manifesto".

Note: As of Build 2198 (released in early June) there is a new setting:

// 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

Setting preview_on_click to false will disable the single-click preview while double-clicking will still open the file. This setting should clear up some confusion.

Sign up to request clarification or add additional context in comments.

5 Comments

is it possible to turn off this feature?
"Ironically, this is a feature and not a bug." - Awesome. Would love this to be optional.
good feature. may be changing tab color or adding a little (p) when previewing would do it more evident.
When double clicking its not opening for me in new tab! But sometimes double click opens in new tab. Whats this? so much annoying!!
@Ivan, You can do this in sublime 3 at least, "highlight_modified_tabs": true,
21

When you open from the side bar are you double clicking? This appears to be required to properly open a file. A single click gives you a preview which is editable, new tab appears on edit.

1 Comment

Yeah. Shortly after posting this question I Did a face palm when I recognized what was going on. Thanks for the reply though.
10

Problem resolved:

Use Double click instead of single click for opening a file in a new tab, which is located in the sidebar of sublime text editor.

3 Comments

I wouldn't say the "problem is resolved". I already know double click will open the file in a new tab, but at least 50% of the time I don't double click fast enough (granted, I use my Macbook Pro Trackpad).
@BoundinCode's solution truly resolves this - setting the preview option to false will prevent the issue of not double clicking fast enough.
As the OP you shouldn't create an answer to summarize the solution, you should select the appropriate answer and up-vote it. Only if you found the solution and intend to mark it as the correct answer should you create one. See "What should I do when someone answers my question?" and "Are answers which merely summarize other answers acceptable?".
8

Go to Sublime --> preferences --> Settings - Default

Change the value of "open_files_in_new_window" to false and save. Now files should be opened in a new tab instead of new window.

2 Comments

This is not a proper answer for the original question.
OS X specific solution.
1

For Sublime Text 3 users, remember that you will need to specify this option in the separate "Settings - user" file

See "Change Default settings in Sublime Text 3" for more information.

Comments

1

When single or double clicking on the files on the sidebar to open the file you may find the filename on the tab is in the italic-theme-slanting-font which I understood as the file is not pinned to the editor. If you click another it will override the current file.

  1. You need to double-click the same current file on the side-bar again to confirm that you need to open this file further.

    NOTE: The editor wont override it, you can confirm it by seeing the tab name style changing from italic to normal with a little bold from its previous form.

  2. Now you can open another file on the sidebar and repeat the process.

3 Comments

If you are not providing any additional/original idea to this answered question, why bother?
i have started using sublime-text and finding out font change gave mean idea about how it works(without knowing about the preview options) and i didnt see any one mentioning about what a preview looks like, Thought it might useful for someone.
This would have been just as effective as a comment instead of an answer.
0

You can Double click on the file which you want to open from left sidebar, which will open file in new tab. As single click means to preview the page and you can also disable the preview option using :

"preview_on_click": false

Comments

0

For Sublime text 2

Go to Sublime --> preferences --> Settings - Default

"open_files_in_new_window":false 
"preview_on_click": false

Comments

-1

Go to your Installed Packages (Preferences->Browse packages ).
Back one folder you find cache folder and local->session file , Just delete them . it ll fix your error .

Comments

-2

For open a file from the side bar in a new tab, open it with alt+click

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.