diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-02-03 22:22:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-03 22:22:00 +0800 |
| commit | f5c4c1d7684d9d39dd469e10322ce6a5df5c3281 (patch) | |
| tree | 0bd86c113b41f692a191d18d976e0dc8f0b430b3 /src/nvim/testdir | |
| parent | 89e308d7daeb8b2344105877200c7c5ae83760b0 (diff) | |
| parent | 3adc3fc540ada79860d90b48b66a1e967421aabf (diff) | |
| download | rneovim-f5c4c1d7684d9d39dd469e10322ce6a5df5c3281.tar.gz rneovim-f5c4c1d7684d9d39dd469e10322ce6a5df5c3281.tar.bz2 rneovim-f5c4c1d7684d9d39dd469e10322ce6a5df5c3281.zip | |
Merge pull request #16818 from zeertzjq/vim-8.2.3454
vim-patch:8.2.{3454,3455,3497,3540,3581,3678}: some "p" and "gp" patches
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_put.vim | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim index 440717eaa8..ed76709a56 100644 --- a/src/nvim/testdir/test_put.vim +++ b/src/nvim/testdir/test_put.vim @@ -1,5 +1,7 @@ " Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc. +source check.vim + func Test_put_block() new call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x') @@ -112,6 +114,39 @@ func Test_put_p_indent_visual() bwipe! endfunc +func Test_gp_with_count_leaves_cursor_at_end() + new + call setline(1, '<---->') + call setreg('@', "foo\nbar", 'c') + normal 1G3|3gp + call assert_equal([0, 4, 4, 0], getpos(".")) + call assert_equal(['<--foo', 'barfoo', 'barfoo', 'bar-->'], getline(1, '$')) + call assert_equal([0, 4, 3, 0], getpos("']")) + + bwipe! +endfunc + +func Test_p_with_count_leaves_mark_at_end() + new + call setline(1, '<---->') + call setreg('@', "start\nend", 'c') + normal 1G3|3p + call assert_equal([0, 1, 4, 0], getpos(".")) + call assert_equal(['<--start', 'endstart', 'endstart', 'end-->'], getline(1, '$')) + call assert_equal([0, 4, 3, 0], getpos("']")) + + bwipe! +endfunc + +func Test_put_above_first_line() + new + let @" = 'text' + silent! normal 0o00 + 0put + call assert_equal('text', getline(1)) + bwipe! +endfunc + func Test_multibyte_op_end_mark() new call setline(1, 'ัะตัั') |