Vala checker: minor cleanup.

This commit is contained in:
LCD 47 2016-06-11 17:24:16 +03:00
parent b8bdaa20be
commit 2e377c7dd3
2 changed files with 17 additions and 15 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-144' let g:_SYNTASTIC_VERSION = '3.7.0-145'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View File

@ -41,35 +41,37 @@ endfunction " }}}1
" Utilities {{{1 " Utilities {{{1
function! s:GetValaModules() " {{{2 function! s:GetValaModules() " {{{2
if exists('g:syntastic_vala_modules') if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules')
if type(g:syntastic_vala_modules) == type('') let modules = syntastic#util#var('vala_modules')
return split(g:syntastic_vala_modules, '\s\+') if type(modules) == type('')
elseif type(g:syntastic_vala_modules) == type([]) return split(modules, '\m\s\+')
return copy(g:syntastic_vala_modules) elseif type(modules) == type([])
return copy(modules)
else else
echoerr 'g:syntastic_vala_modules must be either list or string: fallback to in file modules string' echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string'
endif endif
endif endif
let modules_line = search('^// modules: ', 'n') let modules_line = search('^// modules: ', 'n')
let modules_str = getline(modules_line) let modules_str = getline(modules_line)
return split(strpart(modules_str, 12), '\s\+') return split(strpart(modules_str, 12), '\m\s\+')
endfunction " }}}2 endfunction " }}}2
function! s:GetValaVapiDirs() " {{{2 function! s:GetValaVapiDirs() " {{{2
if exists('g:syntastic_vala_vapi_dirs') if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs')
if type(g:syntastic_vala_vapi_dirs) == type('') let vapi_dirs = syntastic#util#var('vala_vapi_dirs')
return split(g:syntastic_vala_vapi_dirs, '\s\+') if type(vapi_dirs) == type('')
elseif type(g:syntastic_vala_vapi_dirs) == type([]) return split(vapi_dirs, '\m\s\+')
return copy(g:syntastic_vala_vapi_dirs) elseif type(vapi_dirs) == type([])
return copy(vapi_dirs)
else else
echoerr 'g:syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string' echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
endif endif
endif endif
let vapi_line = search('^//\s*vapidirs:\s*','n') let vapi_line = search('^//\s*vapidirs:\s*','n')
let vapi_str = getline(vapi_line) let vapi_str = getline(vapi_line)
return split( substitute( vapi_str, '^//\s*vapidirs:\s*', '', 'g' ), '\s\+' ) return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' )
endfunction " }}}2 endfunction " }}}2
" }}}1 " }}}1