vim-makejob

Minimal, asynchronous quickfix commands for Vim 8.0
git clone git://git.danielmoch.com/vim-makejob.git
Log | Files | Refs | README | LICENSE

commit cf096e4aa83cefdab1f37b4b6a51e2ff09c4f725
parent 9bb9ffad4efd25aff80cb27eedd8053de7ae5c4e
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Mon, 14 May 2018 16:24:24 -0400

Preliminary fix for missing window

Problems exist with the way JobHandler runs when the srcbuf can't be
found. Since the problematic code is trying to clean up the srcbuf
(e.g., removing the local mapping to stop the running makejob), the fix
is to call run this code conditioned on the buffer actually being found.

Diffstat:
Mplugin/makejob.vim | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/plugin/makejob.vim b/plugin/makejob.vim @@ -66,10 +66,13 @@ function! s:JobHandler(channel) abort endif let l:curwinid = win_getid() - call win_gotoid(win_findbuf(l:job['srcbufnr'])[0]) - let l:exitval = job_info(b:makejob).exitval - unlet b:makejob - nunmap <buffer> <C-c> + let l:srcbuf = win_findbuf(l:job['srcbufnr']) + if !empty(l:srcbuf) + call win_gotoid(l:srcbuf[0]) + unlet b:makejob + nunmap <buffer> <C-c> + endif + let l:exitval = job_info(l:job['job']).exitval if l:job['lmake'] let l:qfcmd = l:job['grepadd'] ? 'laddbuffer' : 'lgetbuffer'