Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse messages from guru on close_cb, not exit_cb
There is a race condition in `async_guru` in which not all messages from a `guru` call are displayed: 1. An async `guru` call is started. 2. Lines streamed from `guru` are appended to a message list in `callback()`. 3. The `guru` process ends, `exit_cb()` is called, and the list of messages is processed for display. 4. The rest of the lines from `guru` are appended to the message list. Note that `callback` may still be called after `exit_cb`, as noted in `:help exit_cb`: "exit_cb": handler … Note that data can be buffered, callbacks may still be called after the process ends. This race was recently exposed by [Vim v8.0.1073][vim], which avoids a redraw after statusline evaluation changes a highlight. Since vim-go modifies the goStatusLineColor highlight definition on async calls, the corresponding redraw acted as a delay, masking this data race. The solution to this problem is to process `guru` output in `close_cb`, which is called after all `callback` calls are complete. [vim]: vim/vim@ba2929b
- Loading branch information