commit d661482dcf1b59f59534b6116be459363237f06b
parent b64d2078eb5da1e9729c5fa5894547d450bc9e67
Author: Daniel Moch <daniel@danielmoch.com>
Date: Sun, 7 May 2017 22:37:42 -0400
Fix intermittent error in JobHandler
Callback was occasionally failing to find b:makejob to unlet. I have
reason to believe the nunmap was silently failing as well. Fix both
doing them first thing when we jump to the window containing the source
buffer.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugin/makejob.vim b/plugin/makejob.vim
@@ -65,7 +65,10 @@ function! s:JobHandler(channel) abort
let &errorformat = l:tempefm
endif
+ let l:curwinnr = winnr()
execute bufwinnr(l:job['srcbufnr']).'wincmd w'
+ unlet b:makejob
+ nunmap <buffer> <C-c>
if l:job['lmake']
let l:qfcmd = l:job['grepadd'] ? 'laddbuffer' : 'lgetbuffer'
@@ -78,9 +81,7 @@ function! s:JobHandler(channel) abort
endif
silent execute l:qfcmd.' '.l:job['outbufnr']
silent execute l:job['outbufnr'].'bwipe!'
- unlet b:makejob
- nunmap <buffer> <C-c>
- wincmd p
+ execute l:curwinnr.'wincmd w'
let l:initqf = l:job['lmake'] ? getloclist(bufwinnr(
\ job['srcbufnr'])) : getqflist()