Make jshint executable configurable.

This commit is contained in:
LCD 47 2013-08-12 17:54:57 +03:00
parent e12217e7be
commit e9118ca2aa

View File

@ -9,23 +9,27 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists("g:loaded_syntastic_javascript_jshint_checker")
if exists('g:loaded_syntastic_javascript_jshint_checker')
finish
endif
let g:loaded_syntastic_javascript_jshint_checker=1
if !exists("g:syntastic_javascript_jshint_conf")
let g:syntastic_javascript_jshint_conf = ""
if !exists('g:syntastic_jshint_exec')
let g:syntastic_jshint_exec = 'jshint'
endif
if !exists('g:syntastic_javascript_jshint_conf')
let g:syntastic_javascript_jshint_conf = ''
endif
function! SyntaxCheckers_javascript_jshint_IsAvailable()
return executable('jshint')
return executable(expand(g:syntastic_jshint_exec))
endfunction
function! SyntaxCheckers_javascript_jshint_GetLocList()
let jshint_new = s:JshintNew()
let makeprg = syntastic#makeprg#build({
\ 'exe': 'jshint',
\ 'exe': expand(g:syntastic_jshint_exec),
\ 'post_args': (jshint_new ? ' --verbose ' : '') . s:Args(),
\ 'filetype': 'javascript',
\ 'subchecker': 'jshint' })
@ -41,7 +45,7 @@ function! SyntaxCheckers_javascript_jshint_GetLocList()
endfunction
function s:JshintNew()
return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('jshint --version'), [1, 1])
return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(expand(g:syntastic_jshint_exec) . ' --version'), [1, 1])
endfunction
function s:Args()