aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-06 06:56:24 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-03-15 18:15:18 +0800
commitbfb77544425b7cca372cb87f00ef6b6e87c5f6d5 (patch)
tree874fa2e7b2beee039d5164b3030a2aead15c6998 /test/functional/api/vim_spec.lua
parent2601e0873ff50ed804487dff00bd27e233709beb (diff)
downloadrneovim-bfb77544425b7cca372cb87f00ef6b6e87c5f6d5.tar.gz
rneovim-bfb77544425b7cca372cb87f00ef6b6e87c5f6d5.tar.bz2
rneovim-bfb77544425b7cca372cb87f00ef6b6e87c5f6d5.zip
fix(paste): deal with eol and eof in Visual mode
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 3d57953a11..eaee9211f4 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -702,6 +702,42 @@ describe('API', function()
feed('u')
expect('||')
end)
+ it('stream: Visual mode either end not at the end of a line', function()
+ feed('i|xxx<CR>xxx|<Esc>hvhk')
+ nvim('paste', 'aaaaaa', false, 1)
+ nvim('paste', 'bbbbbb', false, 2)
+ nvim('paste', 'cccccc', false, 2)
+ nvim('paste', 'dddddd', false, 3)
+ expect('|aaaaaabbbbbbccccccdddddd|')
+ feed('u')
+ expect([[
+ |xxx
+ xxx|]])
+ end)
+ it('stream: Visual mode cursor at the end of a line', function()
+ feed('i||xxx<CR>xxx<Esc>vko')
+ nvim('paste', 'aaaaaa', false, 1)
+ nvim('paste', 'bbbbbb', false, 2)
+ nvim('paste', 'cccccc', false, 2)
+ nvim('paste', 'dddddd', false, 3)
+ expect('||aaaaaabbbbbbccccccdddddd')
+ feed('u')
+ expect([[
+ ||xxx
+ xxx]])
+ end)
+ it('stream: Visual mode other end at the end of a line', function()
+ feed('i||xxx<CR>xxx<Esc>vk')
+ nvim('paste', 'aaaaaa', false, 1)
+ nvim('paste', 'bbbbbb', false, 2)
+ nvim('paste', 'cccccc', false, 2)
+ nvim('paste', 'dddddd', false, 3)
+ expect('||aaaaaabbbbbbccccccdddddd')
+ feed('u')
+ expect([[
+ ||xxx
+ xxx]])
+ end)
it('non-streaming', function()
-- With final "\n".
nvim('paste', 'line 1\nline 2\nline 3\n', true, -1)