New option: b:syntastic_mode.
This commit is contained in:
parent
0c1dd2aa01
commit
6fdd394388
@ -459,9 +459,19 @@ the "passive_filetypes" array ("active_filetypes" is ignored).
|
|||||||
If any of "mode", "active_filetypes", or "passive_filetypes" are left
|
If any of "mode", "active_filetypes", or "passive_filetypes" are left
|
||||||
unspecified, they default to values above.
|
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
|
At runtime, the |:SyntasticToggleMode| command can be used to switch between
|
||||||
active and passive modes.
|
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'*
|
*'syntastic_quiet_messages'*
|
||||||
Default: {}
|
Default: {}
|
||||||
Use this option to filter out some of the messages produced by checkers. The
|
Use this option to filter out some of the messages produced by checkers. The
|
||||||
|
@ -291,7 +291,7 @@ function! s:UpdateErrors(auto_invoked, checker_names) " {{{2
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call s:modemap.synch()
|
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
|
if run_checks
|
||||||
call s:CacheErrors(a:checker_names)
|
call s:CacheErrors(a:checker_names)
|
||||||
endif
|
endif
|
||||||
|
@ -38,6 +38,15 @@ function! g:SyntasticModeMap.allowsAutoChecking(filetype) " {{{2
|
|||||||
endif
|
endif
|
||||||
endfunction " }}}2
|
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
|
function! g:SyntasticModeMap.isPassive() " {{{2
|
||||||
return self._mode ==# 'passive'
|
return self._mode ==# 'passive'
|
||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user