New option: b:syntastic_mode.

This commit is contained in:
LCD 47 2014-12-08 11:59:45 +02:00
parent 0c1dd2aa01
commit 6fdd394388
3 changed files with 20 additions and 1 deletions

View File

@ -459,9 +459,19 @@ the "passive_filetypes" array ("active_filetypes" is ignored).
If any of "mode", "active_filetypes", or "passive_filetypes" are left
unspecified, they default to values above.
If local variable |'b:syntastic_mode'| is defined its value takes precedence
over all calculations involving |'syntastic_mode_map'| for the corresponding
buffer.
At runtime, the |:SyntasticToggleMode| command can be used to switch between
active and passive modes.
*'b:syntastic_mode'*
Default: unset
Only the local form |'b:syntastic_mode'| is used. When set to either "active"
or "passive", it takes precedence over |'syntastic_mode_map'| when deciding
whether the corresponding buffer should be checked automatically.
*'syntastic_quiet_messages'*
Default: {}
Use this option to filter out some of the messages produced by checkers. The

View File

@ -291,7 +291,7 @@ function! s:UpdateErrors(auto_invoked, checker_names) " {{{2
endif
call s:modemap.synch()
let run_checks = !a:auto_invoked || s:modemap.allowsAutoChecking(&filetype)
let run_checks = !a:auto_invoked || s:modemap.doAutoChecking()
if run_checks
call s:CacheErrors(a:checker_names)
endif

View File

@ -38,6 +38,15 @@ function! g:SyntasticModeMap.allowsAutoChecking(filetype) " {{{2
endif
endfunction " }}}2
function! g:SyntasticModeMap.doAutoChecking() " {{{2
let local_mode = get(b:, 'syntastic_mode', '')
if local_mode ==# 'active' || local_mode ==# 'passive'
return local_mode ==# 'active'
endif
return self.allowsAutoChecking(&filetype)
endfunction " }}}2
function! g:SyntasticModeMap.isPassive() " {{{2
return self._mode ==# 'passive'
endfunction " }}}2