Is there a way to prevent Vscode from switching windows while navigating the code?

Viewed 345

I use C and typically use two vertical windows.

Is there a way to prevent switching the window while navigating the code?

I often navigate through call graphs by jumping into symbol definitions (F12) and then jump back and forth in the code (ctrl+alt+-/ctrl+shift+-).

What really distracts me is that VSCode decides to open the definition due to some strange logic in a different window, replacing what was selected to be shown there and messing up the context.

For example, jumping to a definition would happen in the same window instead of switching to one of the other windows.

Thanks

1 Answers

Setting workbench.editor.revealIfOpen to false helps.

First problem is with the terms; when I said 'I use two vertical windows' I meant, I had navigated in the menu to View->Editor Layout->Two columns.

So 'vertical windows' is alias for 'two columns', which is actually 'two editor groups'.

Many thanks for https://github.com/IllusionMH for the help.

Related