mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
Merge pull request #12411 from kuuote/fix-remote-plugin-command
runtime: fix remote plugin command fails at some case
This commit is contained in:
commit
fca471d8e2
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user