0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.3072: "zy" does not work well when "virtualedit' is "block"

Problem:    The "zy" command does not work well when 'virtualedit' is set to
            "block". (Johann Höchtl)
Solution:   Make endspaces zero. (Christian Brabandt, closes #8468,
            closes #8448)
This commit is contained in:
Bram Moolenaar
2021-06-28 21:54:27 +02:00
parent 127950241e
commit 7d7bcc6ba0
3 changed files with 25 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
" Tests for various Visual modes.
source shared.vim
source check.vim
func Test_block_shift_multibyte()
" Uses double-wide character.
@@ -1225,5 +1226,24 @@ func Test_visual_put_in_block_using_zy_and_zp()
bwipe!
endfunc
func Test_visual_put_blockedit_zy_and_zp()
new
call setline(1, ['aa', 'bbbbb', 'ccc', '', 'XX', 'GGHHJ', 'RTZU'])
exe "normal! gg0\<c-v>2j$zy"
norm! 5gg0zP
call assert_equal(['aa', 'bbbbb', 'ccc', '', 'aaXX', 'bbbbbGGHHJ', 'cccRTZU'], getline(1, 7))
"
" now with blockmode editing
sil %d
:set ve=block
call setline(1, ['aa', 'bbbbb', 'ccc', '', 'XX', 'GGHHJ', 'RTZU'])
exe "normal! gg0\<c-v>2j$zy"
norm! 5gg0zP
call assert_equal(['aa', 'bbbbb', 'ccc', '', 'aaXX', 'bbbbbGGHHJ', 'cccRTZU'], getline(1, 7))
set ve&vim
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab