changeset 41:933cecbe6f83

fix for remote editor
author Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
date Sun, 19 Dec 2010 03:22:37 +0900
parents 01573c245f15
children 791f78caf8b6
files src/ex_docmd.c src/misc1.c src/os_unix.c src/ui.c
diffstat 4 files changed, 53 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_docmd.c	Sat Dec 18 18:47:04 2010 +0900
+++ b/src/ex_docmd.c	Sun Dec 19 03:22:37 2010 +0900
@@ -12,6 +12,7 @@
  */
 
 #include "vim.h"
+#include "reditor.h"
 
 static int	quitmore = 0;
 static int	ex_pressedreturn = FALSE;
@@ -487,6 +488,12 @@
 #endif
 
 /*
+ * Remote Editor
+ */
+static void ex_repjoin __ARGS((exarg_T *eap));
+static void ex_repput __ARGS((exarg_T *eap));
+
+/*
  * Declare cmdnames[].
  */
 #define DO_DECLARE_EXCMD
@@ -11248,3 +11255,31 @@
     ml_clearmarked();	   /* clear rest of the marks */
 }
 #endif
+
+/*
+ * Remote Editor's Ex commands.
+ */
+
+/* join and get session list */
+static void
+ex_repjoin(eap)
+    exarg_T *eap;
+{
+    if (rep_join() == FALSE) {
+        rep_end();
+        return;
+    }
+
+    return ;
+}
+
+static void
+ex_repput(eap)
+    exarg_T *eap;
+{
+    if (rep_put() == FALSE) {
+        rep_end();
+        return;
+    }
+    return;
+}
--- a/src/misc1.c	Sat Dec 18 18:47:04 2010 +0900
+++ b/src/misc1.c	Sun Dec 19 03:22:37 2010 +0900
@@ -13,6 +13,7 @@
 
 #include "vim.h"
 #include "version.h"
+#include "reditor.h"
 
 static char_u *vim_version_dir __ARGS((char_u *vimdir));
 static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name));
@@ -2734,7 +2735,14 @@
     int		add;
 #endif
 
-    /* mark the buffer as modified */
+        /*
+         * Remote Editor
+         */
+        if(rep_session_permit()){
+            rep_register(lnum,lnume,xtra);
+        }
+
+   /* mark the buffer as modified */
     changed();
 
     /* set the '. mark */
--- a/src/os_unix.c	Sat Dec 18 18:47:04 2010 +0900
+++ b/src/os_unix.c	Sun Dec 19 03:22:37 2010 +0900
@@ -30,6 +30,7 @@
 #endif
 
 #include "vim.h"
+#include "reditor.h"
 
 #ifdef FEAT_MZSCHEME
 # include "if_mzsch.h"
--- a/src/ui.c	Sat Dec 18 18:47:04 2010 +0900
+++ b/src/ui.c	Sun Dec 19 03:22:37 2010 +0900
@@ -17,6 +17,7 @@
  */
 
 #include "vim.h"
+#include "reditor.h"
 
     void
 ui_write(s, len)
@@ -1736,6 +1737,13 @@
     len = 0;	/* to avoid gcc warning */
     for (try = 0; try < 100; ++try)
     {
+    	/*
+    	         * Remote Editor
+    	         */
+    	        if (rep_permit()) {
+    	            rep_select(read_cmd_fd);
+    	        }
+
 #  ifdef VMS
 	len = vms_read(
 #  else