aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2015-03-18 23:43:49 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2015-04-05 11:34:13 +0200
commit34dba3d7cd43b4797d60f636dc9c7c3040a56f3c (patch)
treeccc14f74480c0e15d6ce9819f8e8b34fba711e64
parent5600b80c1fcdf9d056bb7a0b5a74e5563dcb991f (diff)
downloadrneovim-34dba3d7cd43b4797d60f636dc9c7c3040a56f3c.tar.gz
rneovim-34dba3d7cd43b4797d60f636dc9c7c3040a56f3c.tar.bz2
rneovim-34dba3d7cd43b4797d60f636dc9c7c3040a56f3c.zip
clipboard: reallow `:put`
-rw-r--r--src/nvim/.screen.c.swnbin0 -> 16384 bytes
-rw-r--r--src/nvim/ex_docmd.c15
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua16
3 files changed, 21 insertions, 10 deletions
diff --git a/src/nvim/.screen.c.swn b/src/nvim/.screen.c.swn
new file mode 100644
index 0000000000..5b9fe18630
--- /dev/null
+++ b/src/nvim/.screen.c.swn
Binary files differ
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index db4f3a54f1..cf22477dc9 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1699,16 +1699,11 @@ static char_u * do_one_cmd(char_u **cmdlinep,
}
/* accept numbered register only when no count allowed (:put) */
- if ( (ea.argt & REGSTR)
- && *ea.arg != NUL
- /* 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 ((ea.argt & REGSTR)
+ && *ea.arg != NUL
+ /* Do not allow register = for user commands */
+ && (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
+ && !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg))) {
if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
&& !IS_USER_CMDIDX(ea.cmdidx)))) {
ea.regname = *ea.arg++;
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index c1c56c94c1..f1e011f12d 100644
--- a/test/functional/clipboard/clipboard_provider_spec.lua
+++ b/test/functional/clipboard/clipboard_provider_spec.lua
@@ -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()