how to prevent phpstorm from closing deleted files?
I have frequently a lot of files opened in phpstorm. Sometimes I have to switch branch to work on something else before getting back to my original task. If the files I was working on do not exist on the other branch, phpstorm closes them. When I get back to the first branch, I have to manually reopen those files to get back to my original context of work.
Is there a way to prevent phpstorm from closing those files? If it's not possible, what would be the best way to re-open those files?
Please sign in to leave a comment.
Nope, unfortunately, the file has to exist in order to be open as a tab: https://youtrack.jetbrains.com/issue/IDEABKL-7092
However, this should not happen. Do you have
Settings/Preferences | Version Control | Confirmation | Restore workspace on branch switchingenabled?Yes,
Restore workspace on branch switchingis enabled, but I don't switch branch in the IDE as I am more confortable with the command line. I didn't know the context could be saved for each branch when using the IDE. Any chance that it could be maintained by switching branch outside phpstorm?It's not implemented yet, here's the feature request: https://youtrack.jetbrains.com/issue/IDEA-183490
As a workaround, you can of course save and load the contexts manually via Tools | Tasks & Contexts, but it appears to be much easier just to utilize PhpStorm for branches switching.