aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-07-11 15:59:20 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-07-12 22:30:51 +0200
commit6ea2bde065016d4cb2600aa2252daa83f66f09c4 (patch)
tree217ec153fa5cf6622775204b074b68dfd5c7bbf1 /test
parent335be4272eea509fffed4c49f4266b58baa9a3c2 (diff)
downloadrneovim-6ea2bde065016d4cb2600aa2252daa83f66f09c4.tar.gz
rneovim-6ea2bde065016d4cb2600aa2252daa83f66f09c4.tar.bz2
rneovim-6ea2bde065016d4cb2600aa2252daa83f66f09c4.zip
clipboard: fix v:register when clipboard=unnamed,unnamedplus
Diffstat (limited to 'test')
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua2
-rw-r--r--test/functional/fixtures/autoload/provider/clipboard.vim5
2 files changed, 4 insertions, 3 deletions
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index b4febe4bfb..15977b9777 100644
--- a/test/functional/clipboard/clipboard_provider_spec.lua
+++ b/test/functional/clipboard/clipboard_provider_spec.lua
@@ -308,6 +308,7 @@ describe('clipboard usage', function()
end)
it('links the "+ and unnamed registers', function()
+ eq('+', eval('v:register'))
insert("one two")
feed('^"+dwdw"+P')
expect('two')
@@ -335,6 +336,7 @@ describe('clipboard usage', function()
eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['*']"))
-- unnamedplus takes predecence when pasting
+ eq('+', eval('v:register'))
execute("let g:test_clip['+'] = ['the plus','']")
execute("let g:test_clip['*'] = ['the star','']")
feed("p")
diff --git a/test/functional/fixtures/autoload/provider/clipboard.vim b/test/functional/fixtures/autoload/provider/clipboard.vim
index 0935ea45ff..411e095c71 100644
--- a/test/functional/fixtures/autoload/provider/clipboard.vim
+++ b/test/functional/fixtures/autoload/provider/clipboard.vim
@@ -9,13 +9,12 @@ function! s:methods.get(reg)
if g:cliperror
return 0
end
- let reg = a:reg == '"' ? '+' : a:reg
if g:cliplossy
" behave like pure text clipboard
- return g:test_clip[reg][0]
+ return g:test_clip[a:reg][0]
else
" behave like VIMENC clipboard
- return g:test_clip[reg]
+ return g:test_clip[a:reg]
end
endfunction