aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-20 23:53:13 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-27 21:19:10 +0200
commit93e5f0235b8e85423d0284231661ba4b0d7caa07 (patch)
treeaa1111e103437fe28f31a33fdf6d656495bc676f /test/functional/api/vim_spec.lua
parent613296936ba30ae73f3391c2e3c36096f3703c06 (diff)
downloadrneovim-93e5f0235b8e85423d0284231661ba4b0d7caa07.tar.gz
rneovim-93e5f0235b8e85423d0284231661ba4b0d7caa07.tar.bz2
rneovim-93e5f0235b8e85423d0284231661ba4b0d7caa07.zip
API: nvim_put: "follow" parameter
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua31
1 files changed, 25 insertions, 6 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 20046147b8..3f3d9b74bb 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -369,34 +369,53 @@ describe('API', function()
describe('nvim_put', function()
it('inserts text', function()
-- linewise
- nvim('put', {'line 1','line 2','line 3'}, 'l', false)
+ nvim('put', {'line 1','line 2','line 3'}, 'l', true, true)
expect([[
line 1
line 2
line 3]])
+ eq({0,4,1,0}, funcs.getpos('.'))
command('%delete _')
-- charwise
- nvim('put', {'line 1','line 2','line 3'}, 'c', false)
+ nvim('put', {'line 1','line 2','line 3'}, 'c', true, false)
expect([[
line 1
line 2
line 3]])
- command('1')
+ eq({0,1,1,0}, funcs.getpos('.')) -- follow=false
-- blockwise
- nvim('put', {'AA','BB'}, 'b', false)
+ nvim('put', {'AA','BB'}, 'b', true, true)
expect([[
lAAine 1
lBBine 2
line 3]])
+ eq({0,2,4,0}, funcs.getpos('.'))
command('%delete _')
-- Empty lines list.
- nvim('put', {}, 'c', false)
+ nvim('put', {}, 'c', true, true)
+ eq({0,1,1,0}, funcs.getpos('.'))
expect([[]])
-- Single empty line.
- nvim('put', {''}, 'c', false)
+ nvim('put', {''}, 'c', true, true)
+ eq({0,1,1,0}, funcs.getpos('.'))
expect([[
]])
+ nvim('put', {'AB'}, 'c', true, true)
+ -- after=false, follow=true
+ nvim('put', {'line 1','line 2'}, 'c', false, true)
+ expect([[
+ Aline 1
+ line 2B]])
+ eq({0,2,7,0}, funcs.getpos('.'))
+ command('%delete _')
+ nvim('put', {'AB'}, 'c', true, true)
+ -- after=false, follow=false
+ nvim('put', {'line 1','line 2'}, 'c', false, false)
+ expect([[
+ Aline 1
+ line 2B]])
+ eq({0,1,2,0}, funcs.getpos('.'))
eq('', nvim('eval', 'v:errmsg'))
end)
end)