aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2015-03-29 12:39:52 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2015-04-05 11:34:14 +0200
commitadcf268a72827be38510b1830b67b287dec50c4a (patch)
treee427da7ecc32909e3ef31f97b3bb3b146f1fad84 /test
parentdb92fcdba3f596838f524a049efe1c7e82bb734f (diff)
downloadrneovim-adcf268a72827be38510b1830b67b287dec50c4a.tar.gz
rneovim-adcf268a72827be38510b1830b67b287dec50c4a.tar.bz2
rneovim-adcf268a72827be38510b1830b67b287dec50c4a.zip
clipboard: handle clipboard reading directly in `get_yank_register`
This makes :<c-r>* work as expected and avoids clobbering zero register ("0) when pasting unnamed clipboard Helped-By: Scott Prager <splinterofchaos@gmail.com> Helped-By: Michael Reed <m.reed@mykolab.com>
Diffstat (limited to 'test')
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index 74a3bf4ae0..e7ca183a0e 100644
--- a/test/functional/clipboard/clipboard_provider_spec.lua
+++ b/test/functional/clipboard/clipboard_provider_spec.lua
@@ -203,7 +203,6 @@ describe('clipboard usage', function()
it('links the "* and unnamed registers', function()
-- with cb=unnamed, "* and unnamed will be the same register
- execute('set clipboard=unnamed')
insert("some words")
feed('^"*dwdw"*P')
expect('words')
@@ -215,6 +214,19 @@ describe('clipboard usage', function()
words
linewise stuff]])
end)
+
+ it('does not clobber "0 when pasting', function()
+ insert('a line')
+ feed('yy')
+ execute("let g:test_clip['*'] = ['b line','']")
+ feed('"0pp"0p')
+ expect([[
+ a line
+ a line
+ b line
+ a line]])
+ end)
+
end)
it('supports :put', function()
@@ -256,4 +268,13 @@ describe('clipboard usage', function()
[3] = {bold = true, foreground = Screen.colors.SeaGreen}},
{{bold = true, foreground = Screen.colors.Blue}})
end)
+
+ it('can paste "* to the commandline', function()
+ insert('s/s/t/')
+ feed('gg"*y$:<c-r>*<cr>')
+ expect('t/s/t/')
+ execute("let g:test_clip['*'] = ['s/s/u']")
+ feed(':<c-r>*<cr>')
+ expect('t/u/t/')
+ end)
end)