1
0
forked from aniani/vim

patch 8.0.0724: the message for yanking doesn't indicate the register

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)
This commit is contained in:
Bram Moolenaar
2017-07-16 17:56:16 +02:00
parent 9b50bba643
commit e45deb7997
5 changed files with 45 additions and 4 deletions

View File

@@ -184,6 +184,7 @@ NEW_TESTS = test_arabic.res \
test_quickfix.res \
test_quotestar.res \
test_retab.res \
test_registers.res \
test_ruby.res \
test_search.res \
test_signs.res \

View File

@@ -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