Mercurial > hg > RemoteEditor > vim7
changeset 17:efce76870846
*** empty log message ***
author | shinobu |
---|---|
date | Sun, 31 Aug 2008 20:45:38 +0900 |
parents | 8571aeab184c |
children | 70868348fbd8 |
files | src/reditor.c |
diffstat | 1 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/reditor.c Sun Aug 31 17:39:09 2008 +0900 +++ b/src/reditor.c Sun Aug 31 20:45:38 2008 +0900 @@ -894,7 +894,7 @@ char *packet; unsigned int len = 0; - if (text) len += strlen(text);// + 1; /* for include '\0' */ + if (text) len += strlen(text) + 1;// + 1; /* for include '\0' */ if ((packet = (char *)rep_alloc(REP_HEADER_SIZE+len)) == NULL) { return(NULL); @@ -1085,12 +1085,13 @@ return; } //cmd = make_cmd(REP_REPLACE_CMD, sn->sid, rep->eid, rep->seqno++, sn->prevline, get_memline_wrp(sn->buf, sn->prevline)); + // DELETE cmd = make_cmd(REP_DELETE_LINE_CMD, sn->sid, rep->eid, rep->seqno++, sn->prevline, sn->prev_text); - add_cmd_to_list(&(sn->new_cmdlist), cmd); // INSERT - cmd = make_cmd(REP_INSERT_CMD, sn->sid, rep->eid, rep->seqno++, sn->prevline, get_memline_wrp(sn->buf, sn->prevline)); + cmd->next = make_cmd(REP_INSERT_CMD, sn->sid, rep->eid, rep->seqno++, sn->prevline, get_memline_wrp(sn->buf, sn->prevline)); + add_cmd_to_list(&(sn->new_cmdlist), cmd); sn->prevline = lnum; @@ -1128,10 +1129,9 @@ // cmd = make_cmd( REP_REPLACE_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, get_memline_wrp(cursn->buf, lnum)); // DELETE cmd = make_cmd( REP_DELETE_LINE_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, cursn->prev_text); - add_cmd_to_list(&(cursn->new_cmdlist), cmd); // INSERT - cmd = make_cmd( REP_INSERT_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, get_memline_wrp(cursn->buf, lnum)); + cmd->next = make_cmd( REP_INSERT_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, get_memline_wrp(cursn->buf, lnum)); add_cmd_to_list(&(cursn->new_cmdlist), cmd); lnum++; @@ -1144,8 +1144,8 @@ } else { /* xtra < 0 */ xtra = -xtra; for (; xtra > 0; xtra--) { - cmd = make_cmd(REP_DELETE_LINE_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, - NULL); + //cmd = make_cmd(REP_DELETE_LINE_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, NULL); + cmd = make_cmd(REP_DELETE_LINE_CMD, cursn->sid, rep->eid, rep->seqno++, lnum, cursn->prev_text); add_cmd_to_list(&(cursn->new_cmdlist), cmd); } } @@ -1218,9 +1218,11 @@ } rep->slineup = make_session(SLINEUP_NAME, make_new_buf_wrp(SLINEUP_NAME)); append_newline_sep_text(rep->slineup, text); + + rep->slineup->sid = sid; set_cursession(rep->slineup); rep_start_create_cmds(); - //update_screen_now_wrp(); + update_screen_now_wrp(); if (rep->eid == 0) { rep->eid = eid;