I have a tab with the following window structure within:
x is the cursor position.
:ls lists two buffers open on this tab:
Main.cpp is visible on
maininclude.h is visible on
a, if I issue command
:find maininclude.h, this buffer is (re)opened in
a, even though it is currently activie/visible in
b. That is, I end up having two views in two different windows of the same file that I would like to avoid.
Is there a way to favor/privilege the window in which a current buffer is active/visible so that a
:find for that file/buffer issued from any window in the tab automatically goes to that window and places the cursor there? If that buffer is not active/visible in any window, then indeed that buffer should be made active in the window from which
:find was issued from.
An animated gif example of what I am facing is provided here, reproduced below:
set switchbuf=useopen does not work.
See image gif here, reproduced below: