changeset 40:01573c245f15

fix for remote editor
author one@zeus.cr.ie.u-ryukyu.ac.jp
date Sat, 18 Dec 2010 18:47:04 +0900
parents c16898406ff2
children 933cecbe6f83
files src/memline.c src/os_unix.c
diffstat 2 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/memline.c	Fri Dec 17 17:43:06 2010 +0900
+++ b/src/memline.c	Sat Dec 18 18:47:04 2010 +0900
@@ -48,6 +48,11 @@
 
 #include "vim.h"
 
+/*
+   Remote Editor
+ */
+#include "reditor.h"
+
 #ifndef UNIX		/* it's in os_unix.h for Unix */
 # include <time.h>
 #endif
@@ -2541,6 +2546,13 @@
 
     if (curbuf->b_ml.ml_line_lnum != 0)
 	ml_flush_line(curbuf);
+   /*
+    * Remote Editor
+    */
+    if (rep_permit()) {
+       rep_prevline_flush(lnum,1);
+    }
+
     return ml_append_int(curbuf, lnum, line, len, newfile, FALSE);
 }
 
@@ -2562,6 +2574,12 @@
 
     if (buf->b_ml.ml_line_lnum != 0)
 	ml_flush_line(buf);
+    /*
+     * Remote Editor
+     */
+    if (rep_permit()) {
+        rep_prevline_flush(lnum,1);
+    }
     return ml_append_int(buf, lnum, line, len, newfile, FALSE);
 }
 #endif
@@ -3083,6 +3101,12 @@
 {
     if (line == NULL)		/* just checking... */
 	return FAIL;
+    /*
+     * Remote Editor
+     */
+    if (rep_permit()) {
+        rep_prevline_flush(lnum,0);
+    }
 
     /* When starting up, we might still need to create the memfile */
     if (curbuf->b_ml.ml_mfp == NULL && open_buffer(FALSE, NULL, 0) == FAIL)
@@ -3122,6 +3146,12 @@
     int		message;
 {
     ml_flush_line(curbuf);
+    /*
+     * Remote Editor
+     */
+    if (rep_permit()) {
+        rep_prevline_flush(lnum, -1);
+    }
     return ml_delete_int(curbuf, lnum, message);
 }
 
--- a/src/os_unix.c	Fri Dec 17 17:43:06 2010 +0900
+++ b/src/os_unix.c	Sat Dec 18 18:47:04 2010 +0900
@@ -5080,6 +5080,10 @@
 		maxfd = xsmp_icefd;
 	}
 # endif
+	   /* Remote Editor */
+	    if (rep_permit()) {
+	        maxfd = rep_fd_set(&rfds, &efds, maxfd);
+	    }
 #ifdef FEAT_NETBEANS_INTG
 	if (nb_fd != -1)
 	{
@@ -5109,6 +5113,10 @@
 	    /* loop if MzThreads must be scheduled and timeout occurred */
 	    finished = FALSE;
 # endif
+    /* Remote Editor */
+    if ((ret > 0 ) && (rep_permit())) {
+        rep_fd_check(fd, &rfds, &efds);
+    }
 
 # ifdef FEAT_SNIFF
 	if (ret < 0 )