diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-06 06:56:24 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-15 18:15:18 +0800 |
commit | a6eafc77ceaf2d7036aed89361b6556f46131b17 (patch) | |
tree | 0d019d1bb94125849652aa80f468e223a8a52a64 /test/functional/api/vim_spec.lua | |
parent | fcc6f66cf2a67cf85e72727a08e19d0f800badb9 (diff) | |
download | rneovim-a6eafc77ceaf2d7036aed89361b6556f46131b17.tar.gz rneovim-a6eafc77ceaf2d7036aed89361b6556f46131b17.tar.bz2 rneovim-a6eafc77ceaf2d7036aed89361b6556f46131b17.zip |
fix(paste): deal with trailing new line in chunk
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 761cbb4036..9818746251 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -686,6 +686,19 @@ describe('API', function() feed('u') expect('') end) + it('stream: Normal mode on empty line pasting multiple lines', function() + nvim('paste', 'aaaaaa\n', false, 1) + nvim('paste', 'bbbbbb\n', false, 2) + nvim('paste', 'cccccc\n', false, 2) + nvim('paste', 'dddddd', false, 3) + expect([[ + aaaaaa + bbbbbb + cccccc + dddddd]]) + feed('u') + expect('') + end) it('stream: Normal mode not at the end of a line', function() feed('i||<Esc>0') nvim('paste', 'aaaaaa', false, 1) @@ -696,6 +709,20 @@ describe('API', function() feed('u') expect('||') end) + it('stream: Normal mode not at the end of a line pasting multiple lines', function() + feed('i||<Esc>0') + nvim('paste', 'aaaaaa\n', false, 1) + nvim('paste', 'bbbbbb\n', false, 2) + nvim('paste', 'cccccc\n', false, 2) + nvim('paste', 'dddddd', false, 3) + expect([[ + |aaaaaa + bbbbbb + cccccc + dddddd|]]) + feed('u') + expect('||') + end) it('stream: Normal mode at the end of a line', function() feed('i||<Esc>') nvim('paste', 'aaaaaa', false, 1) @@ -706,6 +733,20 @@ describe('API', function() feed('u') expect('||') end) + it('stream: Normal mode at the end of a line pasting multiple lines', function() + feed('i||<Esc>') + nvim('paste', 'aaaaaa\n', false, 1) + nvim('paste', 'bbbbbb\n', false, 2) + nvim('paste', 'cccccc\n', false, 2) + nvim('paste', 'dddddd', false, 3) + expect([[ + ||aaaaaa + bbbbbb + cccccc + dddddd]]) + feed('u') + expect('||') + end) it('stream: Visual mode neither end at the end of a line', function() feed('i|xxx<CR>xxx|<Esc>hvhk') nvim('paste', 'aaaaaa', false, 1) |