Skip to content

Commit

Permalink
Fix intermittent error in JobHandler
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
djmoch committed May 8, 2017
1 parent b64d207 commit d661482
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/makejob.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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()
Expand Down

0 comments on commit d661482

Please sign in to comment.