X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fvimcoder;a=blobdiff_plain;f=src%2Fcom%2Fdogcows%2FEditor.java;h=564e74ff00cdf7b699fef18a9c66be37e552a74f;hp=3bc81d2b3e1b2e51b2c947d1dbb4809ce24eddaf;hb=d5c3685fc4d454fee9b42436c56c2fd18b17a029;hpb=c981f9811ab15c2a521ab6e40b7b5dd7b3f3d88a diff --git a/src/com/dogcows/Editor.java b/src/com/dogcows/Editor.java index 3bc81d2..564e74f 100644 --- a/src/com/dogcows/Editor.java +++ b/src/com/dogcows/Editor.java @@ -74,7 +74,7 @@ public class Editor this.name = component.getClassName(); // Make sure the top-level vimcoder directory exists. - File topDir = new File(System.getProperty("user.home"), ".vimcoder"); + File topDir = VimCoder.getStorageDirectory(); if (!topDir.isDirectory()) { if (!topDir.mkdirs()) throw new IOException(topDir.getPath()); @@ -224,12 +224,14 @@ public class Editor * @param argument Arguments for the remote command. * @throws Exception If the command could not be sent. */ - private void sendVimCommand(String command, + private void sendVimCommand(String command, String[] arguments) throws Exception { - String[] exec = {"gvim", "--servername", "VimCoder" + id, command}; - exec = Util.concat(exec, arguments); - Process child = Runtime.getRuntime().exec(exec, null, directory); + String[] vimCommand = VimCoder.getVimCommand().split("\\s"); + String[] flags = {"--servername", "VimCoder" + id, command}; + vimCommand = Util.concat(vimCommand, flags); + vimCommand = Util.concat(vimCommand, arguments); + Process child = Runtime.getRuntime().exec(vimCommand, null, directory); /* FIXME: This is a hack with a magic number. The problem is the Vim * process doesn't fork to the background on some systems, so we can't