Allow forcing default ns

This commit is contained in:
Tim Pope 2014-10-23 15:39:01 -04:00
parent 97758acc16
commit 8f7a07cffd
1 changed files with 4 additions and 1 deletions

View File

@ -156,7 +156,7 @@ function! s:nrepl_eval(expr, ...) dict abort
throw 'Clojure: Interrupt'
endif
endtry
if has_key(response, 'ns') && !has_key(options, 'ns')
if has_key(response, 'ns') && empty(get(options, 'ns'))
let self.ns = response.ns
endif
@ -198,6 +198,9 @@ function! s:nrepl_prepare(msg) dict abort
if !has_key(msg, 'id')
let msg.id = fireplace#nrepl#next_id()
endif
if empty(get(msg, 'ns', 1))
unlet msg.ns
endif
if empty(get(msg, 'session', 1))
unlet msg.session
elseif !has_key(msg, 'session')