]> Dogcows Code - chaz/vimcoder/blobdiff - src/com/dogcows/Editor.java
storage directory and vim command now configurable
[chaz/vimcoder] / src / com / dogcows / Editor.java
index 3bc81d2b3e1b2e51b2c947d1dbb4809ce24eddaf..564e74ff00cdf7b699fef18a9c66be37e552a74f 100644 (file)
@@ -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
This page took 0.023159 seconds and 4 git commands to generate.