javascript/jsl: update conf flag option

Make it so you only have to set g:syntastic_javascript_jsl_conf to
"/path/to/conf" rather than "-conf /path/to/conf"

Closes #405
This commit is contained in:
Martin Grenfell 2012-11-19 22:19:28 +00:00
parent deaa089884
commit ccecbcb460

View File

@ -12,8 +12,16 @@ if !exists("g:syntastic_javascript_jsl_conf")
let g:syntastic_javascript_jsl_conf = "" let g:syntastic_javascript_jsl_conf = ""
endif endif
function s:ConfFlag()
if !empty(g:syntastic_javascript_jsl_conf)
return "-conf " . g:syntastic_javascript_jsl_conf
endif
return ""
endfunction
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_GetLocList()
let makeprg = "jsl " . g:syntastic_javascript_jsl_conf . " -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%')) let makeprg = "jsl " . s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%'))
let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G' let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction