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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
vernonk
  • 1,221
  • 1
  • 8
  • 14
  • 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? – kolrie Jul 14 '12 at 18:37
  • 6
    +1 for an option to disable this – Brian Armstrong Jul 21 '12 at 19:24
  • this got me too, damn you double click!!!! – tim peterson Aug 24 '12 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. – Lo-Tan Oct 03 '12 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*. – iono Apr 19 '13 at 05:42

10 Answers10

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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Liam Cain
  • 13,283
  • 5
  • 39
  • 29
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.

fraxel
  • 34,470
  • 11
  • 98
  • 102
  • Yeah. Shortly after posting this question I Did a face palm when I recognized what was going on. Thanks for the reply though. – vernonk Mar 04 '12 at 03:20
9

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.

Community
  • 1
  • 1
Raja Parivesh
  • 588
  • 6
  • 12
  • 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). – sudo soul Oct 29 '19 at 17:33
  • @BoundinCode's solution truly resolves this - setting the preview option to false will prevent the issue of not double clicking fast enough. – sudo soul Oct 29 '19 at 17:36
  • 1
    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?](https://stackoverflow.com/help/someone-answers)" and "[Are answers which merely summarize other answers acceptable?](https://meta.stackoverflow.com/q/300586/128421)". – the Tin Man Jan 12 '20 at 21:37
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.

RAMSY
  • 127
  • 1
  • 6
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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
JackDev
  • 4,891
  • 1
  • 39
  • 48
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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Suri13
  • 11
  • 2
  • 1
    If you are not **providing** any additional/original idea to this **answered** question, why bother? – Hearen Jul 16 '18 at 05:48
  • 1
    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. – Suri13 Jul 17 '18 at 10:48
  • This would have been just as effective as a comment instead of an answer. – the Tin Man Jan 12 '20 at 21:43
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

0

For Sublime text 2

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

"open_files_in_new_window":false 
"preview_on_click": false
Nazmul Haque
  • 720
  • 8
  • 13
-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 .

VIKASH DASH
  • 543
  • 1
  • 5
  • 12
-2

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

Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116