Handle interrupt of eval

Closes #72.
This commit is contained in:
Tim Pope 2014-01-11 17:51:13 -05:00
parent f605cd7824
commit 1c55f88e7f

View File

@ -122,7 +122,13 @@ function! s:nrepl_eval(expr, ...) dict abort
endif
call remove(msg, 'code')
endif
let response = self.process(msg)
let msg = self.prepare(msg)
try
let response = self.process(msg)
catch /^Vim:Interrupt$/
call self.call({'op': 'interrupt', 'session': msg.session, 'interrupt-id': msg.id})
throw 'Clojure: Interrupt'
endtry
if has_key(response, 'ns') && !a:0
let self.ns = response.ns
endif