aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorJesse <github@jessebakker.com>2020-05-05 13:18:41 +0200
committerGitHub <noreply@github.com>2020-05-05 13:18:41 +0200
commit48c219829786c14b6e511229a59e2fda32ffe352 (patch)
tree72330aa853951690c4464e0c87b712b746f826f2 /test/functional/api/vim_spec.lua
parenta467f3f665bda399feae440656f38ae573cef27f (diff)
downloadrneovim-48c219829786c14b6e511229a59e2fda32ffe352.tar.gz
rneovim-48c219829786c14b6e511229a59e2fda32ffe352.tar.bz2
rneovim-48c219829786c14b6e511229a59e2fda32ffe352.zip
paste: support replace mode (#11945)
* paste: support replace mode * Clean up Co-authored-by: Jesse Bakker <git@jessebakker.com>
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index fb3755cb8e..2e9d0f57ac 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -571,6 +571,28 @@ describe('API', function()
eq({0,7,1,0}, funcs.getpos('.'))
eq(false, nvim('get_option', 'paste'))
end)
+ it('Replace-mode', function()
+ -- Within single line
+ nvim('put', {'aabbccdd', 'eeffgghh', 'iijjkkll'}, "c", true, false)
+ command('normal l')
+ command('startreplace')
+ nvim('paste', '123456', true, -1)
+ expect([[
+ a123456d
+ eeffgghh
+ iijjkkll]])
+ command('%delete _')
+ -- Across lines
+ nvim('put', {'aabbccdd', 'eeffgghh', 'iijjkkll'}, "c", true, false)
+ command('normal l')
+ command('startreplace')
+ nvim('paste', '123\n456', true, -1)
+ expect([[
+ a123
+ 456d
+ eeffgghh
+ iijjkkll]])
+ end)
it('crlf=false does not break lines at CR, CRLF', function()
nvim('paste', 'line 1\r\n\r\rline 2\nline 3\rline 4\r', false, -1)
expect('line 1\r\n\r\rline 2\nline 3\rline 4\r')