mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
remote/define.vim: support remote function "range"
This commit is contained in:
parent
376ba4e734
commit
d835c030f2
@ -157,6 +157,9 @@ endfunction
|
||||
|
||||
function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
|
||||
let rpcargs = [a:channel, '"'.a:method.'"', 'a:000']
|
||||
if has_key(a:opts, 'range') && a:opts.range != '0'
|
||||
call add(rpcargs, '[a:firstline, a:lastline]')
|
||||
endif
|
||||
call s:AddEval(rpcargs, a:opts)
|
||||
|
||||
let function_def = s:GetFunctionPrefix(a:name, a:opts)
|
||||
@ -218,7 +221,11 @@ endfunction
|
||||
|
||||
|
||||
function! s:GetFunctionPrefix(name, opts)
|
||||
return "function! ".a:name."(...)\n"
|
||||
let res = "function! ".a:name."(...)"
|
||||
if has_key(a:opts, 'range') && a:opts.range != '0'
|
||||
let res = res." range"
|
||||
endif
|
||||
return res."\n"
|
||||
endfunction
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user