aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-31 12:44:42 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-09-02 02:27:13 +0200
commit976c6667e140fe4dfe2731451b25c4a1309ad165 (patch)
treecd472c2334bcffcc83861d1ebbc878ea9efccdb7 /test/functional/api/vim_spec.lua
parent801fe799ff359cdae66ed14f5e0b7c2c4cec9536 (diff)
downloadrneovim-976c6667e140fe4dfe2731451b25c4a1309ad165.tar.gz
rneovim-976c6667e140fe4dfe2731451b25c4a1309ad165.tar.bz2
rneovim-976c6667e140fe4dfe2731451b25c4a1309ad165.zip
paste: one undo-block per stream
- All "chunks" in a paste-stream should form a single undo-block. Side effect of 7a8579288424 was to create an undo-block for each chunk. - Also: remove old :redraw force logic, irrelevant after 7a8579288424.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua29
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)