summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-10 20:08:03 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-10 20:08:03 +0100
commite1edc1caba05c553fa60b1cf45a7670b1cfd63fe (patch)
tree33d1a99276d9b5bd5693421aa1b4d8e07d5270da
parent4514d2769b05faf6edcca42c3ab3d42da84270f1 (diff)
downloadvim-git-e1edc1caba05c553fa60b1cf45a7670b1cfd63fe.tar.gz
patch 7.4.1084v7.4.1084
Problem: Using "." to repeat CTRL-A in Visual mode increments the wrong numbers. Solution: Append right size to the redo buffer. (Ozaki Kiichi)
-rw-r--r--src/normal.c2
-rw-r--r--src/testdir/test_increment.vim22
-rw-r--r--src/version.c2
3 files changed, 25 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index 640c0603e..d513f7516 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -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(' ');
}
}
diff --git a/src/testdir/test_increment.vim b/src/testdir/test_increment.vim
index 277f71d8a..51cc45f98 100644
--- a/src/testdir/test_increment.vim
+++ b/src/testdir/test_increment.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index b0a3a938f..33eef0107 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1084,
+/**/
1083,
/**/
1082,