Search code examples
intellij-ideapycharmsplitter

How to swap splitter windows in Intellij / PyCharm


After splitting the current editor window I navigated to the right one and then created a Scratch File. However the new Scratch File was opened in the left splitter instead.

enter image description here

I can not find any way to swap the contents of the splitter windows. Does such a capability exist? Otherwise how to achieve the same result: do I need to somehow close both windows and open them and in what order?

I am on: IntelliJ IDEA 2021.2.1 (Ultimate Edition) Build #IU-212.5080.55, built on August 23, 2021.


Solution

  • I'm using a similar build: PyCharm 2021.2.1 (Professional Edition) August 25, 2021.

    What I think might be happening is that it's probably not a bug but you momentarily loose focus between the split screens when creating the scratch file. This can be hard to spot because the visual queue is subtle: carefully look at the color underlining the tab. (One of the reasons I'm posting is in case a user with visual impairments or who is color blind runs into this problem). See the screenshot:

    screenshot of splitter tabs

    Try choosing the tab you want and create a scratch file with the shortcut Ctrl+Alt+Shift+Insert.

    I can not find any way to swap the contents of the splitter windows.

    The easiest way to do this is configuring and using the Move to Opposite Group action. Another alternative is using the Goto Next Splitter action.

    It's not entirely possible to fully automate the two above actions into a single keystroke to swap both tabs between the splitters, even if you record a macro choosing the last splitter requires a click.