]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.429 v7.3.429
authorBram Moolenaar <Bram@vim.org>
Sun, 5 Feb 2012 00:18:48 +0000 (01:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 5 Feb 2012 00:18:48 +0000 (01:18 +0100)
Problem:    When 'cpoptions' includes "E" "c0" in the first column is an
            error. The redo register is then set to the errornous command.
Solution:   Do not set the redo register if the command fails because of an
            empty region. (Hideki Eiraku)

src/getchar.c
src/normal.c
src/proto/getchar.pro
src/version.c

index 3d6b0b23a34244b964f44cc6724e985fcfcadf06..af18c6f2498b708c165a0dd92a74f8b9783b7f33 100644 (file)
@@ -470,6 +470,24 @@ ResetRedobuff()
     }
 }
 
+/*
+ * Discard the contents of the redo buffer and restore the previous redo
+ * buffer.
+ */
+    void
+CancelRedo()
+{
+    if (!block_redo)
+    {
+       free_buff(&redobuff);
+       redobuff = old_redobuff;
+       old_redobuff.bh_first.b_next = NULL;
+       start_stuff();
+       while (read_stuff(TRUE) != NUL)
+           ;
+    }
+}
+
 #if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
 /*
  * Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
@@ -691,9 +709,9 @@ stuffnumReadbuff(n)
  * Read a character from the redo buffer.  Translates K_SPECIAL, CSI and
  * multibyte characters.
  * The redo buffer is left as it is.
- * if init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
- * otherwise
- * if old is TRUE, use old_redobuff instead of redobuff
+ * If init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
+ * otherwise.
+ * If old is TRUE, use old_redobuff instead of redobuff.
  */
     static int
 read_redo(init, old_redo)
index a6cd2d6b298269f8e1ac0a4d38a3abf2db75a067..aa470e4f7577bd318a4d7f33ff4e77b68b0e3c24 100644 (file)
@@ -1978,7 +1978,10 @@ do_pending_operator(cap, old_col, gui_yank)
            VIsual_reselect = FALSE;        /* don't reselect now */
 #endif
            if (empty_region_error)
+           {
                vim_beep();
+               CancelRedo();
+           }
            else
            {
                (void)op_delete(oap);
@@ -1992,7 +1995,10 @@ do_pending_operator(cap, old_col, gui_yank)
            if (empty_region_error)
            {
                if (!gui_yank)
+               {
                    vim_beep();
+                   CancelRedo();
+               }
            }
            else
                (void)op_yank(oap, FALSE, !gui_yank);
@@ -2004,7 +2010,10 @@ do_pending_operator(cap, old_col, gui_yank)
            VIsual_reselect = FALSE;        /* don't reselect now */
 #endif
            if (empty_region_error)
+           {
                vim_beep();
+               CancelRedo();
+           }
            else
            {
                /* This is a new edit command, not a restart.  Need to
@@ -2066,7 +2075,10 @@ do_pending_operator(cap, old_col, gui_yank)
        case OP_LOWER:
        case OP_ROT13:
            if (empty_region_error)
+           {
                vim_beep();
+               CancelRedo();
+           }
            else
                op_tilde(oap);
            check_cursor_col();
@@ -2099,7 +2111,10 @@ do_pending_operator(cap, old_col, gui_yank)
 #endif
 #ifdef FEAT_VISUALEXTRA
            if (empty_region_error)
+           {
                vim_beep();
+               CancelRedo();
+           }
            else
            {
                /* This is a new edit command, not a restart.  Need to
@@ -2129,7 +2144,10 @@ do_pending_operator(cap, old_col, gui_yank)
 #ifdef FEAT_VISUALEXTRA
            if (empty_region_error)
 #endif
+           {
                vim_beep();
+               CancelRedo();
+           }
 #ifdef FEAT_VISUALEXTRA
            else
                op_replace(oap, cap->nchar);
index a304bafa53d70d4201a1cf52bde16daa23d949ab..371f77002cdf4607d02daaddb81d78c16e09f56f 100644 (file)
@@ -4,8 +4,9 @@ char_u *get_recorded __ARGS((void));
 char_u *get_inserted __ARGS((void));
 int stuff_empty __ARGS((void));
 void typeahead_noflush __ARGS((int c));
-void flush_buffers __ARGS((int typeahead));
+void flush_buffers __ARGS((int flush_typeahead));
 void ResetRedobuff __ARGS((void));
+void CancelRedo __ARGS((void));
 void saveRedobuff __ARGS((void));
 void restoreRedobuff __ARGS((void));
 void AppendToRedobuff __ARGS((char_u *s));
index 6ba69ea03d8774be2dfd095ab13d7ff2e0a2b4ff..03bdab2627e2466922c142347206c7b9b20c8ac3 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    429,
 /**/
     428,
 /**/