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
1 changed files with 7 additions and 1 deletions

View File

@ -122,7 +122,13 @@ function! s:nrepl_eval(expr, ...) dict abort
endif endif
call remove(msg, 'code') call remove(msg, 'code')
endif 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 if has_key(response, 'ns') && !a:0
let self.ns = response.ns let self.ns = response.ns
endif endif