clipboard: fix let @+ = ... and add test

This commit is contained in:
Björn Linse
2014-11-07 17:31:42 +01:00
parent d9639d3a9b
commit 6ddbe6d9be
2 changed files with 13 additions and 0 deletions

View File

@@ -4825,6 +4825,7 @@ void write_reg_contents_ex(int name,
if (!y_append && !must_append)
free_yank_all();
str_to_reg(y_current, yank_type, str, len, block_len);
set_clipboard(name);
/* ':let @" = "val"' should change the meaning of the "" register */

View File

@@ -106,6 +106,18 @@ describe('clipboard usage', function()
]])
reset()
-- test let @+ (issue #1427)
execute("let @+ = 'some'")
execute("let @* = ' other stuff'")
eq({'some'}, eval("g:test_clip['+']"))
eq({' other stuff'}, eval("g:test_clip['*']"))
feed('"+p"*p')
expect('some other stuff')
execute("let @+ .= ' more'")
feed('dd"+p')
expect('some more')
reset()
-- the basic behavior of unnamed register should be the same
-- even when handled by clipboard provider
execute('set clipboard=unnamed')