posit-dev / positron

Positron, a next-generation data science IDE
Other
2.5k stars 77 forks source link

Focus Source (with RStudio Keymap) doesn't work if source is in a new window #4495

Open FinYang opened 1 month ago

FinYang commented 1 month ago

If the source is in a new window, Focus Source (with RStudio Keymap) doesn't focus the source in the new window, but tries to focus the editor panel in the same window with the console. If there is no source open in that main window, it will try to open an "empty" editor.

Kapture 2024-08-27 at 21 21 49

I was expecting the focus to go back to the new window. If there were multiple new windows, the focus should go back to the new window where the cursor was before focusing console. This is how it works in RStudio:

Kapture 2024-08-27 at 21 29 56

I am very used to writing a few lines in the source then switching to the console to try a few things, and going back and forth between the two. My hands don't need to leave the keyboard in RStudio, but in Positron I have to pause and use the mouse to click to switch back, if I want to view my source in a separate window (on a different monitor).

juliasilge commented 1 month ago

The ability to "float" source editors to a new window is a pretty new feature for VS Code (less than a year old) and seems like there is not currently a command that will focus to such a window. Here are related issues, although I didn't see one specifically to focus in the auxiliary window and then back.

For searchability later, the keybinding Ctrl+ 1 is bound to workbench.action.focusActiveEditorGroup, which currently does not focus an active editor if it in another window.