]> granicus.if.org Git - vim/commitdiff
patch 7.4.1084 v7.4.1084
authorBram Moolenaar <Bram@vim.org>
Sun, 10 Jan 2016 19:08:03 +0000 (20:08 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 10 Jan 2016 19:08:03 +0000 (20:08 +0100)
Problem:    Using "." to repeat CTRL-A in Visual mode increments the wrong
            numbers.
Solution:   Append right size to the redo buffer. (Ozaki Kiichi)

src/normal.c
src/testdir/test_increment.vim
src/version.c

index 640c0603e3b620720c84d7bf15236e75e841d6b3..d513f751626f3da40f8d9b65034f4fdd90e61848 100644 (file)
@@ -3632,7 +3632,7 @@ prep_redo_visual(cap)
        else if (curbuf->b_visual.vi_end.col > curbuf->b_visual.vi_start.col)
        {
            AppendNumberToRedobuff(curbuf->b_visual.vi_end.col
-                                        - curbuf->b_visual.vi_start.col - 1);
+                                            - curbuf->b_visual.vi_start.col);
            AppendCharToRedobuff(' ');
        }
     }
index 277f71d8a43fee5545181913a9b55620c155f421..51cc45f98d643ccdc9cd3afe52a3c32a18a7a440 100644 (file)
@@ -556,6 +556,7 @@ func Test_visual_increment_26()
   exec "norm! \<C-V>$\<C-A>"
   call assert_equal(["0b11111111111111111111111111111111"], getline(1, '$'))
   call assert_equal([0, 1, 1, 0], getpos('.'))
+  set nrformats-=alpha
 endfunc
 
 " 27) increment with 'rightreft', if supported
@@ -575,4 +576,25 @@ func Test_visual_increment_27()
   endif
 endfunc
 
+" 28) block-wise increment and dot-repeat
+" Text:
+"   1 23
+"   4 56
+" 
+" Expected:
+"   1) f2 Ctrl-V jl <ctrl-a>, repeat twice afterwards with .
+"   1 26
+"   4 59
+"
+" Try with and without indent.
+func Test_visual_increment_28()
+  call setline(1, ["  1 23", "  4 56"])
+  exec "norm! ggf2\<C-V>jl\<C-A>.."
+  call assert_equal(["  1 26", "  4 59"], getline(1, 2))
+
+  call setline(1, ["1 23", "4 56"])
+  exec "norm! ggf2\<C-V>jl\<C-A>.."
+  call assert_equal(["1 26", "4 59"], getline(1, 2))
+endfunc
+
 " vim: tabstop=2 shiftwidth=2 expandtab
index b0a3a938f2b5d1a81871283c80874fe427896f30..33eef0107ef6a4097686a0afc0fbf9b4c3d09372 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1084,
 /**/
     1083,
 /**/