mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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
|
endif
|
||||||
|
|
||||||
if has_key(a:opts, 'nargs')
|
if has_key(a:opts, 'nargs')
|
||||||
call add(forward_args, ' <args>')
|
call add(forward_args, ' " . <q-args> . "')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
exe s:GetCommandPrefix(a:name, a:opts)
|
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)
|
runx(sync, handler, on_setup)
|
||||||
end)
|
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()
|
it('with range', function()
|
||||||
call(fn,args..', {"range": ""}')
|
call(fn,args..', {"range": ""}')
|
||||||
local function on_setup()
|
local function on_setup()
|
||||||
|
Loading…
Reference in New Issue
Block a user