patch 8.2.2914: cannot paste a block without adding padding
Problem: Cannot paste a block without adding padding.
Solution: Add "zp" and "zP" which paste without adding padding. (Christian
Brabandt, closes #8289)
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index f6e60a8..48cc46e 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -595,7 +595,7 @@
" Test for errors with z command
func Test_normal_z_error()
call assert_beeps('normal! z2p')
- call assert_beeps('normal! zp')
+ call assert_beeps('normal! zq')
endfunc
func Test_normal15_z_scroll_vert()
diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim
index cd039c0..2b3b213 100644
--- a/src/testdir/test_visual.vim
+++ b/src/testdir/test_visual.vim
@@ -1044,4 +1044,26 @@
bwipe!
endfunc
+func Test_visual_put_in_block_using_zp()
+ new
+ " paste using zP
+ call setline(1, ['/path;text', '/path;text', '/path;text', '',
+ \ '/subdir',
+ \ '/longsubdir',
+ \ '/longlongsubdir'])
+ exe "normal! 5G\<c-v>2j$y"
+ norm! 1Gf;zP
+ call assert_equal(['/path/subdir;text', '/path/longsubdir;text', '/path/longlongsubdir;text'], getline(1, 3))
+ %d
+ " paste using zP
+ call setline(1, ['/path;text', '/path;text', '/path;text', '',
+ \ '/subdir',
+ \ '/longsubdir',
+ \ '/longlongsubdir'])
+ exe "normal! 5G\<c-v>2j$y"
+ norm! 1Gf;hzp
+ call assert_equal(['/path/subdir;text', '/path/longsubdir;text', '/path/longlongsubdir;text'], getline(1, 3))
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab