Handle redefinition of exec after the checker has run.
This commit is contained in:
parent
4782184020
commit
776d4175cd
@ -19,7 +19,7 @@ if has('reltime')
|
|||||||
lockvar! g:_SYNTASTIC_START
|
lockvar! g:_SYNTASTIC_START
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:_SYNTASTIC_VERSION = '3.6.0-27'
|
let g:_SYNTASTIC_VERSION = '3.6.0-28'
|
||||||
lockvar g:_SYNTASTIC_VERSION
|
lockvar g:_SYNTASTIC_VERSION
|
||||||
|
|
||||||
" Sanity checks {{{1
|
" Sanity checks {{{1
|
||||||
@ -486,8 +486,8 @@ function! SyntasticMake(options) " {{{2
|
|||||||
if has_key(a:options, 'env') && len(a:options['env'])
|
if has_key(a:options, 'env') && len(a:options['env'])
|
||||||
for key in keys(a:options['env'])
|
for key in keys(a:options['env'])
|
||||||
if key =~? '\m^[a-z_]\+$'
|
if key =~? '\m^[a-z_]\+$'
|
||||||
exec 'let env_save[' . string(key) . '] = $' . key
|
execute 'let env_save[' . string(key) . '] = $' . key
|
||||||
exec 'let $' . key . ' = ' . string(a:options['env'][key])
|
execute 'let $' . key . ' = ' . string(a:options['env'][key])
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
@ -502,7 +502,7 @@ function! SyntasticMake(options) " {{{2
|
|||||||
let $LC_MESSAGES = old_lc_messages
|
let $LC_MESSAGES = old_lc_messages
|
||||||
if len(env_save)
|
if len(env_save)
|
||||||
for key in keys(env_save)
|
for key in keys(env_save)
|
||||||
exec 'let $' . key . ' = ' . string(env_save[key])
|
execute 'let $' . key . ' = ' . string(env_save[key])
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
" }}}3
|
" }}}3
|
||||||
|
@ -49,9 +49,8 @@ function! g:SyntasticChecker.getName() " {{{2
|
|||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
|
||||||
function! g:SyntasticChecker.getExec() " {{{2
|
function! g:SyntasticChecker.getExec() " {{{2
|
||||||
return
|
call self._syncExec()
|
||||||
\ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
|
return self._exec
|
||||||
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec', self._exec), 1 )
|
|
||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
|
||||||
function! g:SyntasticChecker.getExecEscaped() " {{{2
|
function! g:SyntasticChecker.getExecEscaped() " {{{2
|
||||||
@ -121,6 +120,7 @@ function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
|
|||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
|
||||||
function! g:SyntasticChecker.isAvailable() " {{{2
|
function! g:SyntasticChecker.isAvailable() " {{{2
|
||||||
|
call self._syncExec()
|
||||||
if !has_key(self, '_available')
|
if !has_key(self, '_available')
|
||||||
let self._available = self._isAvailableFunc()
|
let self._available = self._isAvailableFunc()
|
||||||
endif
|
endif
|
||||||
@ -143,6 +143,21 @@ endfunction " }}}2
|
|||||||
|
|
||||||
" Private methods {{{1
|
" Private methods {{{1
|
||||||
|
|
||||||
|
" Synchronise _exec with user's setting. Force re-validation if needed.
|
||||||
|
function! g:SyntasticChecker._syncExec() dict " {{{2
|
||||||
|
let user_exec =
|
||||||
|
\ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
|
||||||
|
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec'), 1 )
|
||||||
|
|
||||||
|
if user_exec != '' && user_exec !=# self._exec
|
||||||
|
let self._exec = user_exec
|
||||||
|
if has_key(self, '_available')
|
||||||
|
" we have a new _exec on the block, it has to be validated
|
||||||
|
call remove(self, '_available')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction " }}}2
|
||||||
|
|
||||||
function! g:SyntasticChecker._quietMessages(errors) " {{{2
|
function! g:SyntasticChecker._quietMessages(errors) " {{{2
|
||||||
" wildcard quiet_messages
|
" wildcard quiet_messages
|
||||||
let quiet_filters = copy(syntastic#util#var('quiet_messages', {}))
|
let quiet_filters = copy(syntastic#util#var('quiet_messages', {}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user