-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calling :CoqJumpToEnd before :CoqStart results in a deadlock on NeoVim. The sequence of events is: 1. Since !s:running(), :CoqJumpToEndcalls coqtail#start with coqtail#jumpto("endpoint") as a callback. 2. coqtail#start calls s:call, which calls s:sendexpr and registers coqtail#after_startCB as its callback. 3. s:chanrecv receives the reply and executes coqtail#after_startCB. 4. coqtail#after_startCB executes coqtail#jumpto, which calls s:call, which calls s:evalexpr. 5. s:evalexpr blocks while waiting for a reply, but s:chanrecv is also blocked waiting for coqtail#after_startCB to return. Commands like :CoqNext don't have this problem because they execute asynchronously, so coqtail#after_startCB calls s:sendexpr instead of s:evalexpr. It also works fine on Vim because it uses the builtin ch_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 for coqtail#start to complete instead of using callbacks. Fixes #360.
- Loading branch information
Showing
6 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters