Merge pull request #12411 from kuuote/fix-remote-plugin-command

runtime: fix remote plugin command fails at some case
This commit is contained in:
Matthieu Coudron 2020-06-06 01:39:12 +02:00 committed by GitHub
commit fca471d8e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -24,7 +24,7 @@ function! remote#define#CommandOnHost(host, method, sync, name, opts)
endif
if has_key(a:opts, 'nargs')
call add(forward_args, ' <args>')
call add(forward_args, ' " . <q-args> . "')
endif
exe s:GetCommandPrefix(a:name, a:opts)

View File

@ -89,6 +89,21 @@ local function command_specs_for(fn, sync, first_arg_factory, init)
runx(sync, handler, on_setup)
end)
it('with nargs/double-quote', function()
call(fn, args..', {"nargs": "*"}')
local function on_setup()
command('RpcCommand "arg1" "arg2" "arg3"')
end
local function handler(method, arguments)
eq('test-handler', method)
eq({'"arg1"', '"arg2"', '"arg3"'}, arguments[1])
return ''
end
runx(sync, handler, on_setup)
end)
it('with range', function()
call(fn,args..', {"range": ""}')
local function on_setup()