Mercurial > hg > RemoteEditor > vim7
changeset 20:5896e8fc8c7f
*** empty log message ***
author | kono |
---|---|
date | Tue, 09 Sep 2008 15:29:36 +0900 |
parents | 03814a8d0b2a |
children | cc45fc3d7c4a |
files | src/reditor.c |
diffstat | 1 files changed, 10 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/reditor.c Mon Sep 08 19:58:08 2008 +0900 +++ b/src/reditor.c Tue Sep 09 15:29:36 2008 +0900 @@ -951,13 +951,15 @@ } else if (xtra==0) { // replace case - // send saved DELETE command - assert(cursn->del_cmd!=0); - cmd = cursn->del_cmd; - rep_send_cmd(rep->smfd,cmd); - rep_free(cmd); - cursn->del_cmd = 0; + if (cursn->del_cmd!=0) { + cmd = cursn->del_cmd; + rep_send_cmd(rep->smfd,cmd); + rep_free(cmd); + cursn->del_cmd = 0; + } else { + // first insert case? + } // send saved new line as INSERT command cmd = make_cmd(REP_INSERT_CMD, cursn->sid, rep->eid, rep->seqno++, cursn->prevline, get_memline_wrp(cursn->buf, lnum)); @@ -1019,10 +1021,6 @@ session = find_session_by_id(sid); - if (textsize == 0) { - text = NULL; - } - switch (cmd) { case REP_JOIN_ACK: /* show session lineup */ @@ -1208,13 +1206,7 @@ int fd; rep_cmd *cur; { - int len = cur->len+REP_HEADER_SIZE ; - while (len>0) { - int i = writen(fd, cur->pkt, len); - if (i<0) return FALSE; - i -= len; - } - return TRUE; + return writen(fd,cur->pkt,cur->len+REP_HEADER_SIZE ); } static int @@ -1233,7 +1225,7 @@ } for (cur = cmdlist->head; cur; cur = cur->next) { - if (rep_send_cmd(fd,cur)==FALSE) { + if (writen(fd,cur->pkt,cur->len+REP_HEADER_SIZE)==FALSE) { return(FALSE); } }