mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(paste): deal with eol and eof in Visual mode
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user