Bug fix: safer checks for deprecated variables.

This commit is contained in:
LCD 47 2016-09-23 06:38:02 +03:00
parent 90b19d188b
commit 59cc80a8f7
2 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.7.0-225' let g:_SYNTASTIC_VERSION = '3.7.0-226'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View File

@ -339,7 +339,10 @@ endfunction " }}}2
" Check for obsolete variable g:syntastic_<filetype>_checker " Check for obsolete variable g:syntastic_<filetype>_checker
function! g:SyntasticRegistry._checkDeprecation(filetype) abort " {{{2 function! g:SyntasticRegistry._checkDeprecation(filetype) abort " {{{2
if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers') if exists('g:syntastic_' . a:filetype . '_checker') &&
\ !exists('g:syntastic_' . a:filetype . '_checkers') &&
\ type(g:syntastic_{a:filetype}_checker) == type('')
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker] let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated') call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
endif endif