nREPL session cloning

This commit is contained in:
Tim Pope 2014-01-12 00:43:13 -05:00
parent 09a0ed93cf
commit 0cfa1eed58
1 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,15 @@ function! s:nrepl_close() dict abort
return self return self
endfunction endfunction
function! s:nrepl_clone() dict abort
let client = copy(self)
if has_key(self, 'session')
let client.session = client.process({'op': 'clone'})['new-session']
let g:fireplace_nrepl_sessions[client.session] = client
endif
return client
endfunction
function! s:nrepl_path() dict abort function! s:nrepl_path() dict abort
return split(self._path[1:-1], self._path[0]) return split(self._path[1:-1], self._path[0])
endfunction endfunction
@ -202,6 +211,7 @@ endfunction
let s:nrepl = { let s:nrepl = {
\ 'close': s:function('s:nrepl_close'), \ 'close': s:function('s:nrepl_close'),
\ 'clone': s:function('s:nrepl_clone'),
\ 'prepare': s:function('s:nrepl_prepare'), \ 'prepare': s:function('s:nrepl_prepare'),
\ 'call': s:function('s:nrepl_call'), \ 'call': s:function('s:nrepl_call'),
\ 'message': s:function('s:nrepl_message'), \ 'message': s:function('s:nrepl_message'),