Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid race condition while starting coqtail
As described in #364, now that `coqtail#start` calls `start` asynchronously, calling a command during `CoqStart` (e.g., `:CoqToLine | CoqToLine`) can cause a race that often results in a fatal error. The solution implemented here is to have `coqtail#start` check if Coqtail is initialized (`s:initted()`) but not yet running (`s:running()`) and, if so, drop the command with a warning. The only difference between `s:initted()` and `s:running()` is whether `b:coqtail_started` is set, so I believe this should ensure that no other commands can run until `coqtail#after_startCB` completes. Since I expect it should be pretty rare in practice for someone to try to run commands before `CoqStart` completes, I think just ignoring them is reasonable. This should not affect commands that are called before `CoqStart`, those will still be queued to run by `coqtail#after_startCB`. Fixes #364.
- Loading branch information