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?

0
3 comments

Is there a way to prevent phpstorm from closing those files?

Nope, unfortunately, the file has to exist in order to be open as a tab: https://youtrack.jetbrains.com/issue/IDEABKL-7092

When I get back to the first branch, I have to manually reopen those files to get back to my original context of work.

However, this should not happen. Do you have Settings/Preferences | Version Control | Confirmation | Restore workspace on branch switching enabled?

0
Avatar
Permanently deleted user

Yes, Restore workspace on branch switching is 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?

0

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.

0

Please sign in to leave a comment.