Closed bhurlow closed 2 years ago
Using finally
instead of catch
allows the exception to propagate. The problem is that interactive eval does waiting differently so that it can talk to stdin, so it needs its own interrupt handler.
@tpope ok great thanks for clarifying. Does that mean interrupt is still handled elsewhere if/when the exception propagates up? What would be the non-interactive eval mode for fireplace?
The exception bubbles up and is displayed as an error message.
Non-interactive eval would include literally anything else, e.g. doc lookup, jump to definition, etc.
@tpope fix works great, thank you
I'm finding that interrupting form evaluation with
<C-c>
doesn't seem to send an interrupt op tonrepl
. Though control is returned to vim, evaluation of the next form is blocked by the currently running eval which may potentially block forever. Here's how I'm reproducing this:Using vim
8.2
for arm,+python3
Starting an
nrepl
instance with no outside deps:setting my
.vimrc
to only usevim-fireplace
to rule out any additional plugin clashesThen in a clojure buffer (src/foo/bar.clj):
If I first eval the sleep form, then issue an interrupt, then finally attempt to eval the
(+ 200 200)
form, it blocks for10s
until returning400
.This thread indicates this was at one point handled via a catch for
catch /^Vim:Interrupt$/
but that was replaced.I found that adding a similar
catch
tofireplace#wait()
like this properly cancels the thread.Is there a reason that approach is not supported? Are other folks encountering this?