clipboard: reallow :put

This commit is contained in:
Björn Linse 2015-03-18 23:43:49 +01:00
parent 5600b80c1f
commit 34dba3d7cd
3 changed files with 21 additions and 10 deletions

BIN
src/nvim/.screen.c.swn Normal file

Binary file not shown.

View File

@ -1704,11 +1704,6 @@ static char_u * do_one_cmd(char_u **cmdlinep,
/* Do not allow register = for user commands */
&& (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
&& !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg))) {
/* check these explicitly for a more specific error message */
if (*ea.arg == '*' || *ea.arg == '+') {
errormsg = (char_u *)_(e_invalidreg);
goto doend;
}
if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
&& !IS_USER_CMDIDX(ea.cmdidx)))) {
ea.regname = *ea.arg++;

View File

@ -160,6 +160,22 @@ describe('clipboard usage', function()
linewise stuff]])
end)
it('supports :put', function()
insert("a line")
execute("let g:test_clip['*'] = ['some text']")
execute("let g:test_clip['+'] = ['more', 'text', '']")
execute(":put *")
expect([[
a line
some text]])
execute(":put +")
expect([[
a line
some text
more
text]])
end)
it('supports "+ and "* in registers', function()
local screen = Screen.new(60, 10)
screen:attach()