Remove s:client

This commit is contained in:
Tim Pope 2014-01-15 21:36:58 -05:00
parent 2a6d23f2fc
commit 76a99139d1

View File

@ -69,7 +69,7 @@ endfunction
function! fireplace#ns_complete(A, L, P) abort function! fireplace#ns_complete(A, L, P) abort
let matches = [] let matches = []
for dir in fireplace#client().path() for dir in fireplace#path()
if dir =~# '\.jar$' if dir =~# '\.jar$'
let files = filter(fireplace#jar_contents(dir), 'v:val =~# "\\.clj$"') let files = filter(fireplace#jar_contents(dir), 'v:val =~# "\\.clj$"')
else else
@ -380,7 +380,7 @@ function! fireplace#path(...) abort
return [] return []
endfunction endfunction
function! s:client(...) abort function! fireplace#client(...) abort
silent doautocmd User FireplacePreConnect silent doautocmd User FireplacePreConnect
let buf = a:0 ? a:1 : s:buf() let buf = a:0 ? a:1 : s:buf()
let root = simplify(fnamemodify(bufname(buf), ':p:s?[\/]$??')) let root = simplify(fnamemodify(bufname(buf), ':p:s?[\/]$??'))
@ -404,12 +404,8 @@ function! s:client(...) abort
throw ':Connect to a REPL or install classpath.vim to evaluate code' throw ':Connect to a REPL or install classpath.vim to evaluate code'
endfunction endfunction
function! fireplace#client(...) abort
return a:0 ? s:client(a:1) : s:client()
endfunction
function! fireplace#message(payload, ...) function! fireplace#message(payload, ...)
let client = s:client() let client = fireplace#client()
let payload = copy(a:payload) let payload = copy(a:payload)
if !has_key(payload, 'ns') if !has_key(payload, 'ns')
let payload.ns = fireplace#ns() let payload.ns = fireplace#ns()
@ -480,7 +476,7 @@ endfunction
function! s:eval(expr, ...) abort function! s:eval(expr, ...) abort
let options = a:0 ? copy(a:1) : {} let options = a:0 ? copy(a:1) : {}
let client = s:client() let client = fireplace#client()
if !has_key(options, 'ns') if !has_key(options, 'ns')
if fireplace#ns() !=# client.user_ns() if fireplace#ns() !=# client.user_ns()
let error = client.require(fireplace#ns()) let error = client.require(fireplace#ns())