11

Say I have a Java class, and navigate to another method by CTRL + CLICK .. The new file opens, in a tab that is positioned to left of the current one. Why? It should open to the right.

Is this a bug? It goes against any other known ways of opening new tabs, like Chrome, Firefox, etc. Is it possible to alter this behaviour?

I would like it to open the tab either at the right side of the current tab, or at the end of the right side.

Makoto
  • 104,088
  • 27
  • 192
  • 230
mjs
  • 21,431
  • 31
  • 118
  • 200
  • Mine opens to the right, too. – mana Oct 10 '12 at 08:59
  • Don't have that problem. Using IntelliJ 11.1.3 Ultimate. – maba Oct 10 '12 at 09:39
  • strange, but I just figured out why. it is a bug. On the settings -> "When closing an editor" I have enabled "Activate right neighbouring tab" ... it seems to affect opening tabs as well. try to change to right.. then tabs will start opening to the left... a bug right? – mjs Oct 10 '12 at 10:16
  • That depends on what setting you have for `Tab limit`. Maybe you are opening a new tab while another one is being closed due to `Tab limit` reached. – maba Oct 10 '12 at 10:39
  • No that is not it. Try for yourself. – mjs Oct 10 '12 at 10:55

3 Answers3

12

If you want to open a new tab at the end of the right side, now IntelliJ IDEA (mine is version 2017.2.4) offers you the option.

Right click at the tab bar and select "Open New Tabs At The End" option.

Open New Tabs At The End option

onelaview
  • 1,121
  • 15
  • 17
9

UPDATE (November 2019)

If you want new editor tabs to be opened at the end, the latest IntelliJ IDEA versions have the dedicated option "Open new tabs at the end" for that in the settings:

Settings > Editor > General > Editor Tabs

enter image description here

Screenshot taken from IntelliJ IDEA 2019.2.4 (Ultimate Edition)

informatik01
  • 16,038
  • 10
  • 74
  • 104
3

This behavior is by design, otherwise if you follow the link in the editor and the new tab opens on the right, after closing this new tab you will be navigated to yet another editor tab on the right instead of returning to the tab from where you started.

This breaks the workflow when you navigate with opening a new tab and want to return back by closing the new tab. It was decided to open new tabs on the left when Activate right neighbouring tab option is enabled.

If you don't like this behavior or want to suggest a better solution, welcome to YouTrack.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • 5
    I suggest you call it "open tabs on the right/left" instead of calling it "do this on close" .. I understand what you are saying, but open a chrome browser, go to google, searh CTRL + Click on links, and close them. It doesn't really break the workflow. The idea is that the tab disappears and in comes something to fill it. Much more intuitive. But I do think that rather than deciding this for us, you should just create another option. Open tabs to the right, close tabs and activate the left/right ... – mjs Oct 10 '12 at 13:50
  • ^ this comment should be YouTrack issue, but there is one related already: http://youtrack.jetbrains.com/issue/IDEA-89731. – CrazyCoder Oct 10 '12 at 14:01
  • Ok, thanks. I also added another one about tabs that should be relatively easy to add. Just allow us to edit the color of the active tab editor, and stop reorganizing. – mjs Oct 10 '12 at 14:33
  • This functionality does make sense. When a new tab opens, it should be in the opposite direction of your "activate on close" direction. Why? Because when you close tabs you opened by ctrl-clicking artifacts in the source, want to arrive at your original file. – Bradley M Handy Oct 25 '12 at 15:08
  • 1
    @CrazyCoder I want to raise this once again. It makes tabs almost useless in Intellij. Also, please allow us to pin tabs that can not be closed. You often have a couple of groups, one with Java files, one with css, one with html and so on. Now, when you open new tabs, CTRL + click new tabs open, but when you want to close the irrelevant ones to get back, you can't. Your groups close down and you are often left in a very irritating state that keeps repeating itself. PLEASE, add this. It is very important! I will pay you! – mjs Oct 08 '14 at 17:07
  • @CrazyCoder Also consider the flow. If you have a couple of pinned tabs and you CTRL + click or open a new file, there should be a choice of how new files open and close. See my comment from earlier: "The idea is that the tab disappears and in comes something to fill it. Much more intuitive. But I do think that rather than deciding this for us, you should just create another option. Open tabs to the right, close tabs and activate the left/right". Also see this post: http://stackoverflow.com/questions/24791128/intellij-idea-pinned-tabs-close-will-close-how-to-disable ... – mjs Oct 08 '14 at 17:11
  • As well as this from today: http://stackoverflow.com/questions/26258957/intellij-move-tab-left-and-right/26261288#26261288 – mjs Oct 08 '14 at 17:12
  • @SecretService please direct your feedback to YouTrack so that it can reach the developers. – CrazyCoder Oct 09 '14 at 00:32
  • @CrazyCoder It's pointless to waste any time on YouTrack. At least here, I can get your attention. Never did my feature suggestions other than bugs gets any attention on youtrack. There is too much shit going on there and you guys keep prioritating adding support for PHP, Ruby and what not. Seriously, fix the issues with the editor and usability. By now, you've probably already started using the plugins we finally had to build to address some of these issues, until an Intellij upgrade came along and destroyed the plugins which required a fix. – mjs Jun 11 '18 at 20:24