Register port file after connecting to port

This commit is contained in:
Jonathan Henry 2014-07-31 00:57:15 -04:00
parent 06f6bc5de6
commit 142fab4e0f
1 changed files with 3 additions and 2 deletions

View File

@ -274,10 +274,11 @@ function! fireplace#register_port_file(portfile, ...) abort
endif endif
if empty(old) && getfsize(a:portfile) > 0 if empty(old) && getfsize(a:portfile) > 0
let port = matchstr(readfile(a:portfile, 'b', 1)[0], '\d\+') let port = matchstr(readfile(a:portfile, 'b', 1)[0], '\d\+')
let s:repl_portfiles[a:portfile] = {'time': getftime(a:portfile)}
try try
let conn = fireplace#nrepl_connection#open(port) let conn = fireplace#nrepl_connection#open(port)
let s:repl_portfiles[a:portfile].connection = conn let s:repl_portfiles[a:portfile] = {
\ 'time': getftime(a:portfile),
\ 'connection': conn}
call s:register_connection(conn, a:0 ? a:1 : '') call s:register_connection(conn, a:0 ? a:1 : '')
return conn return conn
catch /^nREPL Connection Error:/ catch /^nREPL Connection Error:/