diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-09 14:21:04 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-02-09 14:21:04 +0800 |
commit | 3fe47647c7b902d882d3d72158f2712490506a75 (patch) | |
tree | c8c98ee0014d6437a23e04e82c1b44cd2e042151 | |
parent | 196160b1838a462a819bcecb5921b96c2089cb20 (diff) | |
download | rneovim-3fe47647c7b902d882d3d72158f2712490506a75.tar.gz rneovim-3fe47647c7b902d882d3d72158f2712490506a75.tar.bz2 rneovim-3fe47647c7b902d882d3d72158f2712490506a75.zip |
vim-patch:8.2.4315: put in Visual mode not fully tested
Problem: Put in Visual mode not fully tested.
Solution: Add a few more test cases. (closes vim/vim#9708)
https://github.com/vim/vim/commit/6bf821e8abe1da24e5d0624f032d7eda745756e8
-rw-r--r-- | src/nvim/testdir/test_visual.vim | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index e931e06175..099a90643f 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -1195,18 +1195,52 @@ func Test_visual_paste() call setline(1, ['xxxx']) call setreg('"', 'foo') call setreg('-', 'bar') - normal 1Gvp - call assert_equal(@", 'x') - call assert_equal(@-, 'x') + normal gg0vp + call assert_equal('x', @") + call assert_equal('x', @-) + call assert_equal('fooxxx', getline(1)) + normal $vp + call assert_equal('x', @") + call assert_equal('x', @-) + call assert_equal('fooxxx', getline(1)) + " Test with a different register as unnamed register. + call setline(2, ['baz']) + normal 2gg0"rD + call assert_equal('baz', @") + normal gg0vp + call assert_equal('f', @") + call assert_equal('f', @-) + call assert_equal('bazooxxx', getline(1)) + normal $vp + call assert_equal('x', @") + call assert_equal('x', @-) + call assert_equal('bazooxxf', getline(1)) if has('clipboard') " v_P does not overwrite unnamed register. call setline(1, ['xxxx']) call setreg('"', 'foo') call setreg('-', 'bar') - normal 1GvP - call assert_equal(@", 'foo') - call assert_equal(@-, 'x') + normal gg0vP + call assert_equal('foo', @") + call assert_equal('x', @-) + call assert_equal('fooxxx', getline(1)) + normal $vP + call assert_equal('foo', @") + call assert_equal('x', @-) + call assert_equal('fooxxfoo', getline(1)) + " Test with a different register as unnamed register. + call setline(2, ['baz']) + normal 2gg0"rD + call assert_equal('baz', @") + normal gg0vP + call assert_equal('baz', @") + call assert_equal('f', @-) + call assert_equal('bazooxxfoo', getline(1)) + normal $vP + call assert_equal('baz', @") + call assert_equal('o', @-) + call assert_equal('bazooxxfobaz', getline(1)) endif bwipe! |