if (embedded){
parent.setFocus();
}
VimPlugin plugin = VimPlugin.getDefault();
VimConnection conn = plugin.getVimserver(serverID).getVc();
// get the current offset which "setDot" requires.
//String offset = "0";
try{
String cursor = conn.function(bufferID, "getCursor", "");
if (cursor == null){
// the only case that i know of where this happens is if the file is
// open somewhere else and gvim is prompting the user as to how to
// proceed. Exit now or the gvim prompt will be sent to the background.
return;
}
}catch(IOException ioe){
logger.error("Unable to get cursor position.", ioe);
}
// Brings the corresponding buffer to top
//conn.command(bufferID, "setDot", offset);
// Brings the vim editor window to top
conn.command(bufferID, "raise", "");
// to fully focus gvim, we need to simulate a mouse click.
// Should this be optional, via a preference? There is the potential for
// weirdness here.
if (embedded && parent.getDisplay().getActiveShell() != null){