]> granicus.if.org Git - vim/commitdiff
patch 7.4.798 v7.4.798
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Jul 2015 09:21:32 +0000 (11:21 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Jul 2015 09:21:32 +0000 (11:21 +0200)
Problem:    Repeating a change in Visual mode does not work as expected.
            (Urtica Dioica)
Solution:   Make redo in Visual mode work better. (Christian Brabandt)

src/normal.c
src/testdir/test_listlbr.in
src/testdir/test_listlbr.ok
src/version.c

index 599b12ac1f467d9c36f65325be0b201f60fb0640..51aaeccb424851bc2c07af7e881b0892e7bf6eb6 100644 (file)
@@ -9598,18 +9598,23 @@ get_op_vcol(oap, redo_VIsual_vcol, initial)
 #endif
 
     getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol);
-    getvvcol(curwin, &(oap->end), &start, NULL, &end);
 
-    if (start < oap->start_vcol)
-       oap->start_vcol = start;
-    if (end > oap->end_vcol)
+    if (!redo_VIsual_busy)
     {
-       if (initial && *p_sel == 'e' && start >= 1
-                       && start - 1 >= oap->end_vcol)
-           oap->end_vcol = start - 1;
-       else
-           oap->end_vcol = end;
+       getvvcol(curwin, &(oap->end), &start, NULL, &end);
+
+       if (start < oap->start_vcol)
+           oap->start_vcol = start;
+       if (end > oap->end_vcol)
+       {
+           if (initial && *p_sel == 'e' && start >= 1
+                                   && start - 1 >= oap->end_vcol)
+               oap->end_vcol = start - 1;
+           else
+               oap->end_vcol = end;
+       }
     }
+
     /* if '$' was used, get oap->end_vcol from longest line */
     if (curwin->w_curswant == MAXCOL)
     {
index 6af48a75e112d9849645029ca11383af0f3b9cd1..164f12a809869fc72f7ac49172b57753ff528e6c 100644 (file)
@@ -74,6 +74,12 @@ Golong line: \e40afoobar \eaTARGET at end\e
 :let g:test ="Test 8: set linebreak with visual char mode and changing block"
 :$put =g:test
 Go1111-1111-1111-11-1111-1111-1111\e0f-lv3lc2222\ebgj.
+:let g:test ="Test 9: using redo after block visual mode"
+:$put =g:test
+Go
+aaa
+aaa
+a\e2k\162j~e.
 :%w! test.out
 :qa!
 ENDTEST
index 82881234c4eb53167f65c422f045561b96e24470..323bcdee08a7ce0496ebaa469b9597baba50d1e9 100644 (file)
@@ -41,3 +41,8 @@ Test 7: set linebreak with visual block mode and v_b_A
 long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETx at end
 Test 8: set linebreak with visual char mode and changing block
 1111-2222-1111-11-1111-2222-1111
+Test 9: using redo after block visual mode
+
+AaA
+AaA
+A
index f6f30b0522a5ffaad5ac7919f7262693568bcb59..c06287242e133be129077813d1fbf25de2970acc 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    798,
 /**/
     797,
 /**/