]> granicus.if.org Git - vim/commitdiff
updated for version 7.0-022 v7.0.022
authorBram Moolenaar <Bram@vim.org>
Tue, 20 Jun 2006 19:10:43 +0000 (19:10 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 20 Jun 2006 19:10:43 +0000 (19:10 +0000)
src/if_ruby.c
src/version.c

index 29c62b8144e04e2f95ecbb32a2cbad73934121a4..3685db0bc0c6788e75bd81f4519c81d85ab8d16d 100644 (file)
@@ -643,11 +643,23 @@ static VALUE buffer_aref(VALUE self, VALUE num)
 
 static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
 {
-    buf_T *savebuf = curbuf;
-    char *line = STR2CSTR(str);
+    char       *line = STR2CSTR(str);
+#ifdef FEAT_AUTOCMD
+    aco_save_T aco;
+#else
+    buf_T      *save_curbuf = curbuf;
+#endif
 
-    if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
+    if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
+    {
+#ifdef FEAT_AUTOCMD
+       /* set curwin/curbuf for "buf" and save some things */
+       aucmd_prepbuf(&aco, buf);
+#else
        curbuf = buf;
+       curwin->w_buffer = buf;
+#endif
+
        if (u_savesub(n) == OK) {
            ml_replace(n, (char_u *)line, TRUE);
            changed();
@@ -655,10 +667,19 @@ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
            syn_changed(n); /* recompute syntax hl. for this line */
 #endif
        }
-       curbuf = savebuf;
+
+#ifdef FEAT_AUTOCMD
+       /* restore curwin/curbuf and a few other things */
+       aucmd_restbuf(&aco);
+       /* Careful: autocommands may have made "buf" invalid! */
+#else
+       curwin->w_buffer = save_curbuf;
+       curbuf = save_curbuf;
+#endif
        update_curbuf(NOT_VALID);
     }
-    else {
+    else
+    {
        rb_raise(rb_eIndexError, "index %d out of buffer", n);
        return Qnil; /* For stop warning */
     }
@@ -676,12 +697,24 @@ static VALUE buffer_aset(VALUE self, VALUE num, VALUE str)
 
 static VALUE buffer_delete(VALUE self, VALUE num)
 {
-    buf_T *buf = get_buf(self);
-    buf_T *savebuf = curbuf;
-    long n = NUM2LONG(num);
+    buf_T      *buf = get_buf(self);
+    long       n = NUM2LONG(num);
+#ifdef FEAT_AUTOCMD
+    aco_save_T aco;
+#else
+    buf_T      *save_curbuf = curbuf;
+#endif
 
-    if (n > 0 && n <= buf->b_ml.ml_line_count) {
+    if (n > 0 && n <= buf->b_ml.ml_line_count)
+    {
+#ifdef FEAT_AUTOCMD
+       /* set curwin/curbuf for "buf" and save some things */
+       aucmd_prepbuf(&aco, buf);
+#else
        curbuf = buf;
+       curwin->w_buffer = buf;
+#endif
+
        if (u_savedel(n, 1) == OK) {
            ml_delete(n, 0);
 
@@ -691,10 +724,19 @@ static VALUE buffer_delete(VALUE self, VALUE num)
 
            changed();
        }
-       curbuf = savebuf;
+
+#ifdef FEAT_AUTOCMD
+       /* restore curwin/curbuf and a few other things */
+       aucmd_restbuf(&aco);
+       /* Careful: autocommands may have made "buf" invalid! */
+#else
+       curwin->w_buffer = save_curbuf;
+       curbuf = save_curbuf;
+#endif
        update_curbuf(NOT_VALID);
     }
-    else {
+    else
+    {
        rb_raise(rb_eIndexError, "index %d out of buffer", n);
     }
     return Qnil;
@@ -702,13 +744,25 @@ static VALUE buffer_delete(VALUE self, VALUE num)
 
 static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
 {
-    buf_T *buf = get_buf(self);
-    buf_T *savebuf = curbuf;
-    char *line = STR2CSTR(str);
-    long n = NUM2LONG(num);
+    buf_T      *buf = get_buf(self);
+    char       *line = STR2CSTR(str);
+    long       n = NUM2LONG(num);
+#ifdef FEAT_AUTOCMD
+    aco_save_T aco;
+#else
+    buf_T      *save_curbuf = curbuf;
+#endif
 
-    if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
+    if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
+    {
+#ifdef FEAT_AUTOCMD
+       /* set curwin/curbuf for "buf" and save some things */
+       aucmd_prepbuf(&aco, buf);
+#else
        curbuf = buf;
+       curwin->w_buffer = buf;
+#endif
+
        if (u_inssub(n + 1) == OK) {
            ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
 
@@ -718,7 +772,15 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
 
            changed();
        }
-       curbuf = savebuf;
+
+#ifdef FEAT_AUTOCMD
+       /* restore curwin/curbuf and a few other things */
+       aucmd_restbuf(&aco);
+       /* Careful: autocommands may have made "buf" invalid! */
+#else
+       curwin->w_buffer = save_curbuf;
+       curbuf = save_curbuf;
+#endif
        update_curbuf(NOT_VALID);
     }
     else {
index e5a47c58a42e90bdb568cc1027d546f57292a723..b6bbb66a2635b71be92ceb186a7cff6130e528f0 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    22,
 /**/
     21,
 /**/