mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
clipboard: reallow :put
This commit is contained in:
parent
5600b80c1f
commit
34dba3d7cd
BIN
src/nvim/.screen.c.swn
Normal file
BIN
src/nvim/.screen.c.swn
Normal file
Binary file not shown.
@ -1699,16 +1699,11 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* accept numbered register only when no count allowed (:put) */
|
/* accept numbered register only when no count allowed (:put) */
|
||||||
if ( (ea.argt & REGSTR)
|
if ((ea.argt & REGSTR)
|
||||||
&& *ea.arg != NUL
|
&& *ea.arg != NUL
|
||||||
/* Do not allow register = for user commands */
|
/* Do not allow register = for user commands */
|
||||||
&& (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
|
&& (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
|
||||||
&& !((ea.argt & COUNT) && VIM_ISDIGIT(*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
|
if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
|
||||||
&& !IS_USER_CMDIDX(ea.cmdidx)))) {
|
&& !IS_USER_CMDIDX(ea.cmdidx)))) {
|
||||||
ea.regname = *ea.arg++;
|
ea.regname = *ea.arg++;
|
||||||
|
@ -160,6 +160,22 @@ describe('clipboard usage', function()
|
|||||||
linewise stuff]])
|
linewise stuff]])
|
||||||
end)
|
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()
|
it('supports "+ and "* in registers', function()
|
||||||
local screen = Screen.new(60, 10)
|
local screen = Screen.new(60, 10)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
|
Loading…
Reference in New Issue
Block a user