summaryrefslogtreecommitdiff
path: root/src/testdir/test_put.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-24 19:55:43 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-24 19:55:43 +0100
commit941c12da3c087fd04aa6c120a76bf28f19349d96 (patch)
tree296b78adbc71b98ce21b88a6db0bbaef2e1c9c67 /src/testdir/test_put.vim
parentbff6ad133195145f810645c0bde7a2a1fdfc37b8 (diff)
downloadvim-git-941c12da3c087fd04aa6c120a76bf28f19349d96.tar.gz
patch 8.0.0234: crash when using put in Visual modev8.0.0234
Problem: When several lines are visually selected and one of them is short, using put may cause a crash. (Axel Bender) Solution: Check for a short line. (Christian Brabandt)
Diffstat (limited to 'src/testdir/test_put.vim')
-rw-r--r--src/testdir/test_put.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim
index 0154de1ec..38c812bc9 100644
--- a/src/testdir/test_put.vim
+++ b/src/testdir/test_put.vim
@@ -21,3 +21,16 @@ func Test_put_char_block()
call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
bw!
endfunc
+
+func Test_put_char_block2()
+ new
+ let a = [ getreg('a'), getregtype('a') ]
+ call setreg('a', ' one ', 'v')
+ call setline(1, ['Line 1', '', 'Line 3', ''])
+ " visually select the first 3 lines and put register a over it
+ exe "norm! ggl\<c-v>2j2l\"ap"
+ call assert_equal(['L one 1', '', 'L one 3', ''], getline(1,4))
+ " clean up
+ bw!
+ call setreg('a', a[0], a[1])
+endfunc