When a new script tab is opened or switched to, Studio appears to always change focus to the new tab, when there are several cases where this behavior feels resistant to a proper workflow.
In my Studio Settings, I have the settings “Enable Temporary Script Tabs” and “Enable Temporary Script Tabs In Explorer” both enabled, which is convenient to quickly browse scripts in my project. However, when I select scripts in the Explorer, Studio seems to always change focus from the explorer to the newly opened script tab, even temporary tabs.
This behavior makes it inconvenient to, for example, select a script in the Explorer and hit the Delete key to delete it, as it’ll start deleting characters in the Script Editor instead.
Below is a video showing me clicking on a script in the Explorer, which opens a temporary tab. Then you see me hitting the Delete key, which begins deleting the line in the script editor, and also turns the temporary tab into a normal tab as a result. When I select something else and then re-select the script, same result. I have to click the script a second time to force focus to the Explorer window, but this too is error-prone, because if I click the name, it attempts to rename the script instance!
Expected behavior
I would expect focus being changed to the Script Editor to be context-dependent.
- For temporary tabs, I expect Studio not to change focus to it by default, only changing focus to it if you actually click inside the Script Editor.
- When opening a script by double clicking it in the Explorer, focus should change to the Script Editor like normal.
- There are still some cases where script tabs shouldn’t change focus when opened however. For example, if you use the Explorer to delete a script that is currently being viewed in the active tab, this automatically closes the active tab, switching to a different one. When that switch happens, it can take focus away from the Explorer and onto the new tab. I expect it to stay focused on the Explorer when I’m actively deleting things.
Here’s a recording where I use the arrow keys in the Explorer to delete the active script, which causes a tab switch, stealing focus from the Explorer.