I often use split view in Visual Studio Code, e.g., showing a C++ header file in the left view and the associated source file in the right view. What I often do is use the command Go to Definition
(default key binding F12) in the header file (which is open in the left view). And then Visual Studio Code goes on to open the definition in the left view, so that the associated source file is now open in both, the left and the right view.
What I would like Visual Studio Code to do instead is to select the definition in the right view, where the source file is already opened. How to configure Visual Studio Code to do that?
I would like Visual Studio Code to act in the same manner as Visual Studio does, which shows exactly the behavior I would like to see, namely selecting the already opened source file and jumping to the definition there, instead of opening the same file twice in different views.
Visual Studio Code provides the following option which enables the desired behavior:
Reveal If Open
Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group.
It seems to be off by default.