I'm writing a debugger and when hitting a breakpoint or stepping through code I'm making a system call that instructs a gVim server to jump to the current line of the file being debugged, like this:
system_call("gvim --remote-send +\"%dG" --servername DEBUG --remote-tab-silent %s",
line_number, file_name);
The problem is each time gVim receives the command the gVim window steals focus and I have to alt-tab or mouse-click back to the debugger window.
How can I prevent the gVim server window stealing focus when it receives at command?
(I've tagged the question with microsoft-windows
and linux
as I alternate between both operating systems and as such an answer would ideally work on both.)
:help -f
?-f
to the call to gVim and it made no difference; it sill steals focus on every call. What were you thinking it would do?remote_foreground()