diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-11 21:07:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-11 21:07:47 -0400 |
| commit | d09b8ad715ca327766ed9f32c45e1776dae679f4 (patch) | |
| tree | 1137d78266238d2e3de42c3f1fbca8107c57e8f3 /src/nvim/testdir/test_visual.vim | |
| parent | a9b8c780fe3b74cec12747101e351ba7d13451f1 (diff) | |
| parent | 2644fe5b7c7dd0381543da56b9444bda79f14676 (diff) | |
| download | rneovim-d09b8ad715ca327766ed9f32c45e1776dae679f4.tar.gz rneovim-d09b8ad715ca327766ed9f32c45e1776dae679f4.tar.bz2 rneovim-d09b8ad715ca327766ed9f32c45e1776dae679f4.zip | |
Merge pull request #14761 from janlazo/vim-8.2.2966
vim-patch:8.2.{1702,2422,2966,2971,2974}
Diffstat (limited to 'src/nvim/testdir/test_visual.vim')
| -rw-r--r-- | src/nvim/testdir/test_visual.vim | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index 21fd57b791..a40b0236e0 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -1006,4 +1006,59 @@ func Test_visual_put_in_block_using_zp() bwipe! endfunc +func Test_visual_put_in_block_using_zy_and_zp() + new + + " Test 1) Paste using zp - after the cursor without trailing spaces + call setline(1, ['/path;text', '/path;text', '/path;text', '', + \ 'texttext /subdir columntext', + \ 'texttext /longsubdir columntext', + \ 'texttext /longlongsubdir columntext']) + exe "normal! 5G0f/\<c-v>2jezy" + norm! 1G0f;hzp + call assert_equal(['/path/subdir;text', '/path/longsubdir;text', '/path/longlongsubdir;text'], getline(1, 3)) + + " Test 2) Paste using zP - in front of the cursor without trailing spaces + %d + call setline(1, ['/path;text', '/path;text', '/path;text', '', + \ 'texttext /subdir columntext', + \ 'texttext /longsubdir columntext', + \ 'texttext /longlongsubdir columntext']) + exe "normal! 5G0f/\<c-v>2jezy" + norm! 1G0f;zP + call assert_equal(['/path/subdir;text', '/path/longsubdir;text', '/path/longlongsubdir;text'], getline(1, 3)) + + " Test 3) Paste using p - with trailing spaces + %d + call setline(1, ['/path;text', '/path;text', '/path;text', '', + \ 'texttext /subdir columntext', + \ 'texttext /longsubdir columntext', + \ 'texttext /longlongsubdir columntext']) + exe "normal! 5G0f/\<c-v>2jezy" + norm! 1G0f;hp + call assert_equal(['/path/subdir ;text', '/path/longsubdir ;text', '/path/longlongsubdir;text'], getline(1, 3)) + + " Test 4) Paste using P - with trailing spaces + %d + call setline(1, ['/path;text', '/path;text', '/path;text', '', + \ 'texttext /subdir columntext', + \ 'texttext /longsubdir columntext', + \ 'texttext /longlongsubdir columntext']) + exe "normal! 5G0f/\<c-v>2jezy" + norm! 1G0f;P + call assert_equal(['/path/subdir ;text', '/path/longsubdir ;text', '/path/longlongsubdir;text'], getline(1, 3)) + + " Test 5) Yank with spaces inside the block + %d + call setline(1, ['/path;text', '/path;text', '/path;text', '', + \ 'texttext /sub dir/ columntext', + \ 'texttext /lon gsubdir/ columntext', + \ 'texttext /lon glongsubdir/ columntext']) + exe "normal! 5G0f/\<c-v>2jf/zy" + norm! 1G0f;zP + call assert_equal(['/path/sub dir/;text', '/path/lon gsubdir/;text', '/path/lon glongsubdir/;text'], getline(1, 3)) + bwipe! +endfunc + + " vim: shiftwidth=2 sts=2 expandtab |