"Open Files with Single Click" opens it again in main window even if already open in another window


I've got two windows open, but the same project.  I've also got "Open Files with Single Click" enabled in the Project view. options. 

  • If, in the Project view, I click on a file I've not yet opened, IDEA opens that file in the main window in a new tab (as to be expected). 
  • If I select a different tab in the main window, and then again click on the original file in the project view, IDEA selects the tab for that file in the main window, rather than creating a new tab (again, as to be expected).
  • However, if I then drag that tab to the other window, and then again click on the same file in the Project view, IDEA opens another tab for that file back in the main window, rather than simply selecting the tab for the already open file in the second window (and maybe bringing that window forward, if it is not already on top).

This is not intuitive.  Is there some way to configure this so it prefers selecting an existing tab over opening another tab?

If I really wanted two tabs (two editors) for the same file, I would explicitly use the split right, or split down on the tab's menu.

BTW, bookmarks work as would be expected: Select a bookmark and the tab, if one already exists in a second window, is opened and that window is brought forward (although I have to double click to get the window to come forward, even if bookmarks are set for "Navigate with single click"). 

The use case is that I'm editing one set of files (e.g.: a component) and referencing a second set of files for reference (e.g.: another, similar, component) in the second window.  As is, more than a couple of times now, I've accidentally started editing the reference files by mistake when they appear in the window that I intended for my actively edited code.

IntelliJ IDEA 2022.2.3 (Ultimate Edition)

Build #IU-222.4345.14, built on October 5, 2022




Hello Mike,

I reported issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-323115

Please follow it for updates.