diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-01 19:12:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-01 19:12:13 -0700 |
commit | b10d703213da5699a176c7791a51a322f248dbd2 (patch) | |
tree | 72a8132da5e844284b9bc9e2947e9518e01f7395 /test/functional/api/vim_spec.lua | |
parent | 938be1e0ab1c3772f329f39225e651deb1cd6aca (diff) | |
parent | 8560bafc6cf7cfd301c1389a9e2562aeec592294 (diff) | |
download | rneovim-b10d703213da5699a176c7791a51a322f248dbd2.tar.gz rneovim-b10d703213da5699a176c7791a51a322f248dbd2.tar.bz2 rneovim-b10d703213da5699a176c7791a51a322f248dbd2.zip |
Merge #10896 'paste: one undo-block'
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 02e83c4d58..851feddb54 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -373,6 +373,35 @@ describe('API', function() expect_err('Invalid phase: 4', request, 'nvim_paste', 'foo', true, 4) end) + it('stream: multiple chunks form one undo-block', function() + nvim('paste', '1/chunk 1 (start)\n', true, 1) + nvim('paste', '1/chunk 2 (end)\n', true, 3) + local expected1 = [[ + 1/chunk 1 (start) + 1/chunk 2 (end) + ]] + expect(expected1) + nvim('paste', '2/chunk 1 (start)\n', true, 1) + nvim('paste', '2/chunk 2\n', true, 2) + expect([[ + 1/chunk 1 (start) + 1/chunk 2 (end) + 2/chunk 1 (start) + 2/chunk 2 + ]]) + nvim('paste', '2/chunk 3\n', true, 2) + nvim('paste', '2/chunk 4 (end)\n', true, 3) + expect([[ + 1/chunk 1 (start) + 1/chunk 2 (end) + 2/chunk 1 (start) + 2/chunk 2 + 2/chunk 3 + 2/chunk 4 (end) + ]]) + feed('u') -- Undo. + expect(expected1) + end) it('non-streaming', function() -- With final "\n". nvim('paste', 'line 1\nline 2\nline 3\n', true, -1) |