Skip to content

Commit

Permalink
Serialize makers - Fixes neovim#22
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Harper committed Jan 11, 2015
1 parent 1e21094 commit ba75da5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions autoload/neomake.vim
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ function! neomake#Make(options) abort
let b:neomake_signs = {}
endif

let serialize = get(g:, 'neomake_serialize')
for name in enabled_makers
if name ==# 'makeprg'
call neomake#MakeJob()
Expand All @@ -223,8 +224,16 @@ function! neomake#Make(options) abort
let maker['tempfile'] = makepath
let maker['tempsuffix'] = tempsuffix
endif
if serialize && len(enabled_makers) > 1
let next_opts = copy(a:options)
let next_opts['enabled_makers'] = enabled_makers[1:]
let maker['next'] = next_opts
endif
call neomake#MakeJob(maker)
endif
if serialize
break
endif
endfor
endfunction

Expand Down Expand Up @@ -412,6 +421,13 @@ function! neomake#MakeHandler(...) abort
endif
" Show the current line's error
call neomake#CursorMoved()

" TODO when neovim implements getting the exit status of a job, add
" option to only run next checkers if this one succeeded.
if has_key(maker, 'next')
call neomake#utils#DebugMessage('Neomake: next makers ['.join(maker.next.enabled_makers, ', ').']')
call neomake#Make(maker.next)
endif
endif
endfunction

Expand Down
6 changes: 6 additions & 0 deletions doc/neomake.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ Setting this to 1 allows neomake to check unsaved changes. Set to 0 by
default. This setting does nothing when running |:Neomake!| (in other words,
it is only active when running |:Neomake|).

*g:neomake_serialize*
Setting this to 1 tells neomake to run each enabled maker one after the other.
This is a good way to ensure messages don't get mixed up. When Neovim's
|job-control| feature implements a way to get the exit status of a job, an
option will be added to stop after the first failing job as well.

*g:neomake_verbose*
Controls how verbose neomake should be. Neomake log levels are as follows:
0 - Errors only
Expand Down

0 comments on commit ba75da5

Please sign in to comment.