Make b:syntastic_skip_checks suitable for general use.

Document `b:syntastic_skip_checks`.  Minor cleanup.
This commit is contained in:
LCD 47 2014-09-16 06:36:37 +03:00
parent 7cdfd91c99
commit aac0775c39
2 changed files with 12 additions and 6 deletions

View File

@ -518,6 +518,12 @@ statusline: >
< <
If the buffer had 2 warnings, starting on line 5 then this would appear: > If the buffer had 2 warnings, starting on line 5 then this would appear: >
[Warn: 5 #2] [Warn: 5 #2]
<
*'b:syntastic_skip_checks'*
Default: unset
Only the local form |'b:syntastic_skip_checks'| is used. When set to a true
value, no checks are run against the corresponding buffer. Example: >
let b:syntastic_skip_checks = 1
< <
*'syntastic_full_redraws'* *'syntastic_full_redraws'*
Default: 0 in GUI Vim and MacVim, 1 otherwise Default: 0 in GUI Vim and MacVim, 1 otherwise

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:syntastic_start lockvar! g:syntastic_start
endif endif
let g:syntastic_version = '3.5.0-7' let g:syntastic_version = '3.5.0-10'
lockvar g:syntastic_version lockvar g:syntastic_version
" Sanity checks {{{1 " Sanity checks {{{1
@ -230,7 +230,7 @@ endfunction " }}}2
function! s:QuitPreHook() " {{{2 function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands, call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr(""))))) \ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = !g:syntastic_check_on_wq let b:syntastic_skip_checks = get(b:, 'syntastic_skip_checks', 0) || !syntastic#util#var('check_on_wq')
call SyntasticLoclistHide() call SyntasticLoclistHide()
endfunction " }}}2 endfunction " }}}2
@ -557,9 +557,9 @@ endfunction " }}}2
" Skip running in special buffers " Skip running in special buffers
function! s:skipFile() " {{{2 function! s:skipFile() " {{{2
let fname = expand('%') let fname = expand('%')
let skip = (exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0) || let skip = get(b:, 'syntastic_skip_checks', 0) || (&buftype != '') ||
\ (&buftype != '') || !filereadable(fname) || getwinvar(0, '&diff') || \ !filereadable(fname) || getwinvar(0, '&diff') || s:ignoreFile(fname) ||
\ s:ignoreFile(fname) || fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions \ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
if skip if skip
call syntastic#log#debug(g:SyntasticDebugTrace, 'skipFile: skipping') call syntastic#log#debug(g:SyntasticDebugTrace, 'skipFile: skipping')
endif endif