diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-08-08 14:45:44 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-08-08 14:45:44 +0000 |
commit | 334a3bfb0daeff6bea4f041ad16d5bcb7acaf571 (patch) | |
tree | 985d6dd72de335e3c0d3bd5c029c46b93964e5a4 | |
parent | 3709e7c885c178863a6c31300b3bda2145442a59 (diff) | |
download | vim-git-334a3bfb0daeff6bea4f041ad16d5bcb7acaf571.tar.gz |
updated for version 7.0-044v7.0.044
-rw-r--r-- | src/if_perl.xs | 66 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 58 insertions, 10 deletions
diff --git a/src/if_perl.xs b/src/if_perl.xs index 14cb86f2c..ee3f15f17 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -1056,7 +1056,6 @@ Set(vimbuf, ...) int i; long lnum; char *line; - buf_T *savebuf; PPCODE: if (buf_valid(vimbuf)) { @@ -1069,14 +1068,31 @@ Set(vimbuf, ...) line = SvPV(ST(i),PL_na); if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL) { - savebuf = curbuf; + #ifdef FEAT_AUTOCMD + aco_save_T aco; + + /* set curwin/curbuf for "vimbuf" and save some things */ + aucmd_prepbuf(&aco, vimbuf); + #else + buf_T *save_curbuf = curbuf; + curbuf = vimbuf; + curwin->w_buffer = vimbuf; + #endif if (u_savesub(lnum) == OK) { ml_replace(lnum, (char_u *)line, TRUE); changed_bytes(lnum, 0); } - curbuf = savebuf; + + #ifdef FEAT_AUTOCMD + /* restore curwin/curbuf and a few other things */ + aucmd_restbuf(&aco); + /* Careful: autocommands may have made "vimbuf" invalid! */ + #else + curwin->w_buffer = save_curbuf; + curbuf = save_curbuf; + #endif } } } @@ -1087,7 +1103,6 @@ Delete(vimbuf, ...) PREINIT: long i, lnum = 0, count = 0; - buf_T *savebuf; PPCODE: if (buf_valid(vimbuf)) { @@ -1114,16 +1129,31 @@ Delete(vimbuf, ...) { if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count) { - savebuf = curbuf; + buf_T *save_curbuf = curbuf; + #ifdef FEAT_AUTOCMD + aco_save_T aco; + + /* set curwin/curbuf for "vimbuf" and save some things */ + aucmd_prepbuf(&aco, vimbuf); + #else curbuf = vimbuf; + curwin->w_buffer = vimbuf; + #endif if (u_savedel(lnum, 1) == OK) { ml_delete(lnum, 0); deleted_lines_mark(lnum, 1L); - if (savebuf == curbuf) + if (save_curbuf == curbuf) check_cursor(); } - curbuf = savebuf; + #ifdef FEAT_AUTOCMD + /* restore curwin/curbuf and a few other things */ + aucmd_restbuf(&aco); + /* Careful: autocommands may have made "vimbuf" invalid! */ + #else + curwin->w_buffer = save_curbuf; + curbuf = save_curbuf; + #endif update_curbuf(VALID); } } @@ -1138,7 +1168,6 @@ Append(vimbuf, ...) int i; long lnum; char *line; - buf_T *savebuf; PPCODE: if (buf_valid(vimbuf)) { @@ -1151,14 +1180,31 @@ Append(vimbuf, ...) line = SvPV(ST(i),PL_na); if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL) { - savebuf = curbuf; + #ifdef FEAT_AUTOCMD + aco_save_T aco; + + /* set curwin/curbuf for "vimbuf" and save some things */ + aucmd_prepbuf(&aco, vimbuf); + #else + buf_T *save_curbuf = curbuf; + curbuf = vimbuf; + curwin->w_buffer = vimbuf; + #endif if (u_inssub(lnum + 1) == OK) { ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE); appended_lines_mark(lnum, 1L); } - curbuf = savebuf; + + #ifdef FEAT_AUTOCMD + /* restore curwin/curbuf and a few other things */ + aucmd_restbuf(&aco); + /* Careful: autocommands may have made "vimbuf" invalid! */ + #else + curwin->w_buffer = save_curbuf; + curbuf = save_curbuf; + #endif update_curbuf(VALID); } } diff --git a/src/version.c b/src/version.c index ce312d4a8..a2e336950 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 44, +/**/ 43, /**/ 42, |