aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ops.c1
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua12
2 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 1513eb2cbc..c20a017088 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -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 */
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index 0f11615bdc..ccbb74e487 100644
--- a/test/functional/clipboard/clipboard_provider_spec.lua
+++ b/test/functional/clipboard/clipboard_provider_spec.lua
@@ -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')