aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index c5d8f57008..716bd88242 100644
--- a/test/functional/clipboard/clipboard_provider_spec.lua
+++ b/test/functional/clipboard/clipboard_provider_spec.lua
@@ -73,6 +73,12 @@ local function basic_register_test(noblock)
stuf, stuff and some more
me tsome textsome some text, stuff and some more]])
end
+
+ -- pasting in visual does unnamed delete of visual selection
+ feed('ggdG')
+ insert("one and two and three")
+ feed('"ayiwbbviw"ap^viwp$viw"-p')
+ expect("two and three and one")
end
describe('the unnamed register', function()
@@ -241,6 +247,14 @@ describe('clipboard usage', function()
eq('\02210', eval('getregtype()'))
end)
+ it('yanks visual selection when pasting', function()
+ insert("indeed visual")
+ execute("let g:test_clip['*'] = [['clipboard'], 'c']")
+ feed("viwp")
+ eq({{'visual'}, 'v'}, eval("g:test_clip['*']"))
+ expect("indeed clipboard")
+ end)
+
end)
it('supports :put', function()
@@ -291,4 +305,28 @@ describe('clipboard usage', function()
feed(':<c-r>*<cr>')
expect('t/u/t/')
end)
+
+ it('supports :redir @*>', function()
+ execute("let g:test_clip['*'] = ['stuff']")
+ execute('redir @*>')
+ -- it is made empty
+ eq({{''}, 'v'}, eval("g:test_clip['*']"))
+ execute('let g:test = doesnotexist')
+ feed('<cr>')
+ eq({{
+ '',
+ '',
+ 'E121: Undefined variable: doesnotexist',
+ 'E15: Invalid expression: doesnotexist',
+ }, 'v'}, eval("g:test_clip['*']"))
+ execute(':echo "Howdy!"')
+ eq({{
+ '',
+ '',
+ 'E121: Undefined variable: doesnotexist',
+ 'E15: Invalid expression: doesnotexist',
+ '',
+ 'Howdy!',
+ }, 'v'}, eval("g:test_clip['*']"))
+ end)
end)