aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2015-04-11 17:49:47 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2015-04-17 11:34:06 +0200
commitedb13791bd6eda43ab3816c7697530b378680e61 (patch)
tree5ec736cb0e7b1299a47ed9d51d45825538312d6a /test
parent84b7a9ac34244a2d3f2356dbd9cebf1961281d42 (diff)
downloadrneovim-edb13791bd6eda43ab3816c7697530b378680e61.tar.gz
rneovim-edb13791bd6eda43ab3816c7697530b378680e61.tar.bz2
rneovim-edb13791bd6eda43ab3816c7697530b378680e61.zip
clipboard: simplify handling of of put in visual mode.
When clipboard=unnamed and put over visual selection, reduces number of provider calls from 6 to 2. Also add test.
Diffstat (limited to 'test')
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index c5d8f57008..52fdfaa8f4 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()