]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.269 v7.4.269
authorBram Moolenaar <Bram@vim.org>
Tue, 29 Apr 2014 12:44:35 +0000 (14:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 29 Apr 2014 12:44:35 +0000 (14:44 +0200)
Problem:    CTRL-U in Insert mode does not work after using a cursor key.
            (Pine Wu)
Solution:   Use the original insert start position. (Christian Brabandt)

src/edit.c
src/testdir/test29.in
src/testdir/test29.ok
src/version.c

index 24010c8d9cf5320e96f470f26afe5fba099aaf95..a0ad9aaed7bd98de20e88926ff8f000cc6aed1c6 100644 (file)
@@ -8760,8 +8760,8 @@ ins_bs(c, mode, inserted_space_p)
                ((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
                    || (!can_bs(BS_START)
                        && (arrow_used
-                           || (curwin->w_cursor.lnum == Insstart.lnum
-                               && curwin->w_cursor.col <= Insstart.col)))
+                           || (curwin->w_cursor.lnum == Insstart_orig.lnum
+                               && curwin->w_cursor.col <= Insstart_orig.col)))
                    || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
                                         && curwin->w_cursor.col <= ai_col)
                    || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0))))
@@ -8812,8 +8812,8 @@ ins_bs(c, mode, inserted_space_p)
      */
     if (curwin->w_cursor.col == 0)
     {
-       lnum = Insstart.lnum;
-       if (curwin->w_cursor.lnum == Insstart.lnum
+       lnum = Insstart_orig.lnum;
+       if (curwin->w_cursor.lnum == lnum
 #ifdef FEAT_RIGHTLEFT
                        || revins_on
 #endif
@@ -8822,8 +8822,8 @@ ins_bs(c, mode, inserted_space_p)
            if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
                               (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
                return FALSE;
-           --Insstart.lnum;
-           Insstart.col = MAXCOL;
+           --Insstart_orig.lnum;
+           Insstart_orig.col = MAXCOL;
        }
        /*
         * In replace mode:
@@ -8981,9 +8981,9 @@ ins_bs(c, mode, inserted_space_p)
            while (vcol < want_vcol)
            {
                /* Remember the first char we inserted */
-               if (curwin->w_cursor.lnum == Insstart.lnum
-                                  && curwin->w_cursor.col < Insstart.col)
-                   Insstart.col = curwin->w_cursor.col;
+               if (curwin->w_cursor.lnum == Insstart_orig.lnum
+                                  && curwin->w_cursor.col < Insstart_orig.col)
+                   Insstart_orig.col = curwin->w_cursor.col;
 
 #ifdef FEAT_VREPLACE
                if (State & VREPLACE_FLAG)
@@ -9071,8 +9071,8 @@ ins_bs(c, mode, inserted_space_p)
                revins_on ||
 #endif
                (curwin->w_cursor.col > mincol
-                && (curwin->w_cursor.lnum != Insstart.lnum
-                    || curwin->w_cursor.col != Insstart.col)));
+                && (curwin->w_cursor.lnum != Insstart_orig.lnum
+                    || curwin->w_cursor.col != Insstart_orig.col)));
        did_backspace = TRUE;
     }
 #ifdef FEAT_SMARTINDENT
@@ -9090,9 +9090,9 @@ ins_bs(c, mode, inserted_space_p)
     AppendCharToRedobuff(c);
 
     /* If deleted before the insertion point, adjust it */
-    if (curwin->w_cursor.lnum == Insstart.lnum
-                                      && curwin->w_cursor.col < Insstart.col)
-       Insstart.col = curwin->w_cursor.col;
+    if (curwin->w_cursor.lnum == Insstart_orig.lnum
+                                      && curwin->w_cursor.col < Insstart_orig.col)
+       Insstart_orig.col = curwin->w_cursor.col;
 
     /* vi behaviour: the cursor moves backward but the character that
      *              was there remains visible
index 2df2f7077e9f24fa923f846fcca59d5fca0d264a..1d6cb6f4d161b926f29eac00af85a8e780258deb 100644 (file)
@@ -101,6 +101,34 @@ if (condition) // Remove the next comment leader!
     action();
 }
 
+STARTTEST
+:" Test with backspace set to the non-compatible setting
+/^\d\+ this
+:set cp bs=2
+Avim1\15\e
+Avim2\au\15\e
+:set cpo-=<
+:inoremap <c-u> <left><c-u>
+Avim3\15\e
+:iunmap <c-u>
+Avim4\15\15\e
+:" Test with backspace set to the compatible setting
+:set bs=
+A vim5\eA\15\15\e
+A vim6\eAzwei\au\15\e
+:inoremap <c-u> <left><c-u>
+A vim7\15\15\e
+:set cp
+ENDTEST
+1 this shouldn't be deleted
+2 this shouldn't be deleted
+3 this shouldn't be deleted
+4 this should be deleted
+5 this shouldn't be deleted
+6 this shouldn't be deleted
+7 this shouldn't be deleted
+8 this shouldn't be deleted (not touched yet)
+
 STARTTEST
 /^{/+1
 :set comments=sO:*\ -,mO:*\ \ ,exO:*/
index 902d52f49b22ad7925a2ad271aa7106f9611dbf5..9dc07ed46bb6869923915a66086b938afec71bc2 100644 (file)
@@ -62,6 +62,15 @@ if (condition) // Remove the next comment leader! OK, I will.
     action();
 }
 
+1 this shouldn't be deleted
+2 this shouldn't be deleted
+3 this shouldn't be deleted
+4 this should be deleted3
+
+6 this shouldn't be deleted vim5
+7 this shouldn't be deleted vim6
+8 this shouldn't be deleted (not touched yet) vim7
+
 
 {
 /* Make sure the previous comment leader is not removed.  */
index bd97da3a4d8abeeaee7d54c561806d35458ae9bb..f13edda8310fccd85a6fa50cd5702f7452ce1f05 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    269,
 /**/
     268,
 /**/