summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_registers.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-16 17:56:16 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-16 17:56:16 +0200
commite45deb79978677cb41f1477ba4140bccff658fd1 (patch)
tree61497b56b7a9fe1525645a3f1c1979753825a603 /src/testdir/test_registers.vim
parent9b50bba643f8d1fcac91e11780da7d03d8995260 (diff)
patch 8.0.0724: the message for yanking doesn't indicate the registerv8.0.0724
Problem: The message for yanking doesn't indicate the register. Solution: Show the register name in the "N lines yanked" message. (Lemonboy, closes #1803, closes #1809)
Diffstat (limited to 'src/testdir/test_registers.vim')
-rw-r--r--src/testdir/test_registers.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim
new file mode 100644
index 0000000000..912a5c7e3d
--- /dev/null
+++ b/src/testdir/test_registers.vim
@@ -0,0 +1,27 @@
+
+func Test_yank_shows_register()
+ enew
+ set report=0
+ call setline(1, ['foo', 'bar'])
+ " Line-wise
+ exe 'norm! yy'
+ call assert_equal('1 line yanked', v:statusmsg)
+ exe 'norm! "zyy'
+ call assert_equal('1 line yanked into "z', v:statusmsg)
+ exe 'norm! yj'
+ call assert_equal('2 lines yanked', v:statusmsg)
+ exe 'norm! "zyj'
+ call assert_equal('2 lines yanked into "z', v:statusmsg)
+
+ " Block-wise
+ exe "norm! \<C-V>y"
+ call assert_equal('block of 1 line yanked', v:statusmsg)
+ exe "norm! \<C-V>\"zy"
+ call assert_equal('block of 1 line yanked into "z', v:statusmsg)
+ exe "norm! \<C-V>jy"
+ call assert_equal('block of 2 lines yanked', v:statusmsg)
+ exe "norm! \<C-V>j\"zy"
+ call assert_equal('block of 2 lines yanked into "z', v:statusmsg)
+
+ bwipe!
+endfunc