Nikolay Georgiev
Nikolay Georgiev

Reputation: 1093

How to prevent PyCharm from automatically closing opened files?

From time to time I need to open multiple files in PyCharm. Every opened file has a visible tab on the top of the editor. From my observations when the visible tabs take the space of two rows PyCharm starts to automatically close the files opened first. How can I prevent this? Often I really need to open the files that PyCharm automatically closes and my productivity drops immediately!

Upvotes: 24

Views: 9605

Answers (2)

NicoNing
NicoNing

Reputation: 3212

After upgraded to 2022.3 or later,

  1. checked Settings (Preferences on macOS) | Advanced Settings | "Open declaration source called from a detached window in the main IDE window"

otherwise, default option is "Open declaration source in the same tab", which overrides Editor Tabs | Tab limit

  1. Disable Editor Tabs | "Enable Preview Tab" in project explorer.

otherwise, it will still "Open declaration source in the same tab" in pycharmCE, php, webstorm.

  1. Alter Editor Tabs | Tab limit .

it will finally work.

refer: https://intellij-support.jetbrains.com/hc/en-us/community/posts/8867988275090-IntelliJ-Ultimate-2022-3-Make-code-links-open-in-new-tab

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 401877

Windows: Settings | Editor | General | Editor Tabs | Tab limit

Mac: Preferences | Editor | General | Editor Tabs | Tab limit

Under the Tab Closing Policy group, the default is 10, set it to some larger value.

Upvotes: 45

Related Questions