aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-04-18 05:43:21 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-04-18 05:43:21 -0400
commit1b1b920ba8f40a47e7fe7ce4968c7017878635d4 (patch)
treef2c3aa32582c3c601bf031f2efb8edfc9545d2e7 /runtime
parentef92cca7cc2c75e67ff53e247782c76cadef5a83 (diff)
parenta347b29aa3caf245a99e12bfc8167f3bf882f770 (diff)
downloadrneovim-1b1b920ba8f40a47e7fe7ce4968c7017878635d4.tar.gz
rneovim-1b1b920ba8f40a47e7fe7ce4968c7017878635d4.tar.bz2
rneovim-1b1b920ba8f40a47e7fe7ce4968c7017878635d4.zip
Merge #4553
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/remote/define.vim13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/autoload/remote/define.vim b/runtime/autoload/remote/define.vim
index ca1def0941..b04a5d2280 100644
--- a/runtime/autoload/remote/define.vim
+++ b/runtime/autoload/remote/define.vim
@@ -1,7 +1,7 @@
function! remote#define#CommandOnHost(host, method, sync, name, opts)
let prefix = ''
- if has_key(a:opts, 'range')
+ if has_key(a:opts, 'range')
if a:opts.range == '' || a:opts.range == '%'
" -range or -range=%, pass the line range in a list
let prefix = '<line1>,<line2>'
@@ -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')
+ call add(rpcargs, '[a:firstline, a:lastline]')
+ endif
call s:AddEval(rpcargs, a:opts)
let function_def = s:GetFunctionPrefix(a:name, a:opts)
@@ -187,7 +190,7 @@ let s:next_gid = 1
function! s:GetNextAutocmdGroup()
let gid = s:next_gid
let s:next_gid += 1
-
+
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
" Ensure the group is defined
exe 'augroup '.group_name.' | augroup END'
@@ -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')
+ let res = res." range"
+ endif
+ return res."\n"
endfunction