Pass additional .message arguments to callback

This commit is contained in:
Tim Pope 2014-07-10 22:39:15 -04:00
parent 3e978e4cd4
commit ebb2933f4c
2 changed files with 3 additions and 3 deletions

View File

@ -198,12 +198,12 @@ function! s:nrepl_prepare(msg) dict abort
return msg return msg
endfunction endfunction
function! fireplace#nrepl#callback(body, type, fn) function! fireplace#nrepl#callback(body, type, callback)
let response = {'body': a:body, 'type': a:type} let response = {'body': a:body, 'type': a:type}
if has_key(g:fireplace_nrepl_sessions, get(a:body, 'session')) if has_key(g:fireplace_nrepl_sessions, get(a:body, 'session'))
let response.session = g:fireplace_nrepl_sessions[a:body.session] let response.session = g:fireplace_nrepl_sessions[a:body.session]
endif endif
call call(a:fn, [response]) call call(a:callback[0], [response] + a:callback[1:-1])
endfunction endfunction
function! s:nrepl_call(msg, ...) dict abort function! s:nrepl_call(msg, ...) dict abort

View File

@ -105,7 +105,7 @@ function! s:nrepl_transport_call(msg, terms, sels, ...) dict abort
if !a:0 if !a:0
return response return response
elseif a:1 !=# 'ignore' elseif a:1 !=# 'ignore'
return map(response, 'fireplace#nrepl#callback(v:val, "synchronous", a:1)') return map(response, 'fireplace#nrepl#callback(v:val, "synchronous", a:000)')
endif endif
endfunction endfunction