Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Calling
:CoqJumpToEnd
before:CoqStart
results in a deadlock on NeoVim. The sequence of events is:!s:running()
,:CoqJumpToEnd
callscoqtail#start
withcoqtail#jumpto("endpoint")
as a callback.coqtail#start
callss:call
, which callss:sendexpr
and registerscoqtail#after_startCB
as its callback.s:chanrecv
receives the reply and executescoqtail#after_startCB
.coqtail#after_startCB
executescoqtail#jumpto
, which callss:call
, which callss:evalexpr
.s:evalexpr
blocks while waiting for a reply, buts:chanrecv
is also blocked waiting forcoqtail#after_startCB
to return.Commands like
:CoqNext
don't have this problem because they execute asynchronously, socoqtail#after_startCB
callss:sendexpr
instead ofs:evalexpr
. It also works fine on Vim because it uses the builtinch_evalexpr
, which handles other messages while waiting for a reply.The ideal solution would be to somehow execute callbacks asynchronously, but I couldn't figure out a way of doing that in vimscript. Perhaps it's possible with Lua. In any case, I realized that the only synchronous commands that could be called before
:CoqStart
are:CoqJumpToEnd
,:CoqJumpToError
, and:CoqGotoDef
, so I just have these cases busy wait forcoqtail#start
to complete instead of using callbacks.Fixes #360.