comparison src/testdir/test_increment.vim @ 7568:5274513d3f54 v7.4.1084

commit https://github.com/vim/vim/commit/e1edc1caba05c553fa60b1cf45a7670b1cfd63fe Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 20:08:03 2016 +0100 patch 7.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)
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jan 2016 20:15:04 +0100
parents f624d7671e0c
children b872724c37db
comparison
equal deleted inserted replaced
7567:45c2189b7d48 7568:5274513d3f54
554 set nrformats+=alpha 554 set nrformats+=alpha
555 call setline(1, ["0b11111111111111111111111111111110"]) 555 call setline(1, ["0b11111111111111111111111111111110"])
556 exec "norm! \<C-V>$\<C-A>" 556 exec "norm! \<C-V>$\<C-A>"
557 call assert_equal(["0b11111111111111111111111111111111"], getline(1, '$')) 557 call assert_equal(["0b11111111111111111111111111111111"], getline(1, '$'))
558 call assert_equal([0, 1, 1, 0], getpos('.')) 558 call assert_equal([0, 1, 1, 0], getpos('.'))
559 set nrformats-=alpha
559 endfunc 560 endfunc
560 561
561 " 27) increment with 'rightreft', if supported 562 " 27) increment with 'rightreft', if supported
562 func Test_visual_increment_27() 563 func Test_visual_increment_27()
563 if exists('+rightleft') 564 if exists('+rightleft')
573 call assert_equal([0, 1, 7, 0], getpos('.')) 574 call assert_equal([0, 1, 7, 0], getpos('.'))
574 set norightleft 575 set norightleft
575 endif 576 endif
576 endfunc 577 endfunc
577 578
579 " 28) block-wise increment and dot-repeat
580 " Text:
581 " 1 23
582 " 4 56
583 "
584 " Expected:
585 " 1) f2 Ctrl-V jl <ctrl-a>, repeat twice afterwards with .
586 " 1 26
587 " 4 59
588 "
589 " Try with and without indent.
590 func Test_visual_increment_28()
591 call setline(1, [" 1 23", " 4 56"])
592 exec "norm! ggf2\<C-V>jl\<C-A>.."
593 call assert_equal([" 1 26", " 4 59"], getline(1, 2))
594
595 call setline(1, ["1 23", "4 56"])
596 exec "norm! ggf2\<C-V>jl\<C-A>.."
597 call assert_equal(["1 26", "4 59"], getline(1, 2))
598 endfunc
599
578 " vim: tabstop=2 shiftwidth=2 expandtab 600 " vim: tabstop=2 shiftwidth=2 expandtab