Formatting: folding.

This commit is contained in:
LCD 47 2015-01-04 12:46:54 +02:00
parent c472ec1396
commit 1d2f8d514a
174 changed files with 480 additions and 422 deletions

View File

@ -64,4 +64,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -44,4 +44,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -46,4 +46,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -44,4 +44,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,14 +22,14 @@ endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_asm_gcc_IsAvailable() dict function! SyntaxCheckers_asm_gcc_IsAvailable() dict " {{{1
if !exists('g:syntastic_asm_compiler') if !exists('g:syntastic_asm_compiler')
let g:syntastic_asm_compiler = self.getExec() let g:syntastic_asm_compiler = self.getExec()
endif endif
return executable(expand(g:syntastic_asm_compiler, 1)) return executable(expand(g:syntastic_asm_compiler, 1))
endfunction endfunction " }}}1
function! SyntaxCheckers_asm_gcc_GetLocList() dict function! SyntaxCheckers_asm_gcc_GetLocList() dict " {{{1
return syntastic#c#GetLocList('asm', 'gcc', { return syntastic#c#GetLocList('asm', 'gcc', {
\ 'errorformat': \ 'errorformat':
\ '%-G%f:%s:,' . \ '%-G%f:%s:,' .
@ -37,12 +37,16 @@ function! SyntaxCheckers_asm_gcc_GetLocList() dict
\ '%f:%l:%c: %tarning: %m,' . \ '%f:%l:%c: %tarning: %m,' .
\ '%f:%l: %m', \ '%f:%l: %m',
\ 'main_flags': '-x assembler -fsyntax-only -masm=' . s:GetDialect() }) \ 'main_flags': '-x assembler -fsyntax-only -masm=' . s:GetDialect() })
endfunction endfunction " }}}1
function! s:GetDialect() " Utilities {{{1
function! s:GetDialect() " {{{2
return exists('g:syntastic_asm_dialect') ? g:syntastic_asm_dialect : return exists('g:syntastic_asm_dialect') ? g:syntastic_asm_dialect :
\ expand('%:e', 1) ==? 'asm' ? 'intel' : 'att' \ expand('%:e', 1) ==? 'asm' ? 'intel' : 'att'
endfunction endfunction " }}}2
" }}}1
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'asm', \ 'filetype': 'asm',
@ -51,4 +55,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -32,4 +32,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -57,4 +57,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -54,4 +54,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -57,4 +57,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -58,4 +58,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -58,4 +58,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -59,4 +59,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -56,4 +56,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -58,4 +58,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -62,4 +62,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -63,4 +63,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -45,4 +45,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -52,4 +52,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -52,4 +52,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -36,4 +36,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -44,4 +44,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -44,4 +44,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -58,4 +58,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -46,4 +46,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -37,4 +37,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,4 +22,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'exec': 'clang-check', \ 'exec': 'clang-check',
\ 'redirect': 'c/clang_check'}) \ 'redirect': 'c/clang_check'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,4 +22,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'exec': 'clang-tidy', \ 'exec': 'clang-tidy',
\ 'redirect': 'c/clang_tidy'}) \ 'redirect': 'c/clang_tidy'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -21,4 +21,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'cppcheck', \ 'name': 'cppcheck',
\ 'redirect': 'c/cppcheck'}) \ 'redirect': 'c/cppcheck'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -49,4 +49,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -53,4 +53,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -21,4 +21,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'oclint', \ 'name': 'oclint',
\ 'redirect': 'c/oclint'}) \ 'redirect': 'c/oclint'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -23,4 +23,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'exec': 'lint-nt', \ 'exec': 'lint-nt',
\ 'redirect': 'c/pc_lint'}) \ 'redirect': 'c/pc_lint'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -36,4 +36,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -44,4 +44,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,4 +22,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'phpcs', \ 'name': 'phpcs',
\ 'redirect': 'php/phpcs'}) \ 'redirect': 'php/phpcs'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -58,4 +58,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -23,4 +23,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'recess', \ 'name': 'recess',
\ 'redirect': 'less/recess'}) \ 'redirect': 'less/recess'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -39,4 +39,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -63,4 +63,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -57,4 +57,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -73,4 +73,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -52,4 +52,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,4 +22,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'xmllint', \ 'name': 'xmllint',
\ 'redirect': 'xml/xmllint'}) \ 'redirect': 'xml/xmllint'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -35,4 +35,4 @@ call SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -56,4 +56,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -58,4 +58,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -39,4 +39,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -75,4 +75,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -49,4 +49,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -27,7 +27,7 @@ let s:glsl_extensions = {
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_glsl_cgc_GetLocList() dict function! SyntaxCheckers_glsl_cgc_GetLocList() dict " {{{1
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({
\ 'args_before': '-oglsl -profile ' . s:GetProfile(), \ 'args_before': '-oglsl -profile ' . s:GetProfile(),
\ 'args': (exists('g:syntastic_glsl_options') ? ' ' . g:syntastic_glsl_options : '') }) \ 'args': (exists('g:syntastic_glsl_options') ? ' ' . g:syntastic_glsl_options : '') })
@ -39,9 +39,11 @@ function! SyntaxCheckers_glsl_cgc_GetLocList() dict
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat }) \ 'errorformat': errorformat })
endfunction endfunction " }}}1
function! s:GetProfile() " Utilities {{{1
function! s:GetProfile() " {{{2
let save_view = winsaveview() let save_view = winsaveview()
let old_foldenable = &foldenable let old_foldenable = &foldenable
let old_lazyredraw = &lazyredraw let old_lazyredraw = &lazyredraw
@ -65,7 +67,9 @@ function! s:GetProfile()
endif endif
return profile return profile
endfunction endfunction " }}}2
" }}}1
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\'filetype': 'glsl', \'filetype': 'glsl',
@ -74,4 +78,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -89,4 +89,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -42,4 +42,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -39,4 +39,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -43,4 +43,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -49,4 +49,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -43,4 +43,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -34,4 +34,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -40,4 +40,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -80,4 +80,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -53,4 +53,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -36,4 +36,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -40,4 +40,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -60,4 +60,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -35,4 +35,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -51,4 +51,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -23,6 +23,11 @@ if exists("g:loaded_syntastic_html_tidy_checker")
endif endif
let g:loaded_syntastic_html_tidy_checker = 1 let g:loaded_syntastic_html_tidy_checker = 1
let s:save_cpo = &cpo
set cpo&vim
" Checker options {{{1
if !exists('g:syntastic_html_tidy_ignore_errors') if !exists('g:syntastic_html_tidy_ignore_errors')
let g:syntastic_html_tidy_ignore_errors = [] let g:syntastic_html_tidy_ignore_errors = []
endif endif
@ -39,27 +44,9 @@ if !exists('g:syntastic_html_tidy_empty_tags')
let g:syntastic_html_tidy_empty_tags = [] let g:syntastic_html_tidy_empty_tags = []
endif endif
let s:save_cpo = &cpo " }}}1
set cpo&vim
" TODO: join this with xhtml.vim for DRY's sake? " Constants {{{1
function! s:TidyEncOptByFenc()
let TIDY_OPTS = {
\ 'utf-8': '-utf8',
\ 'ascii': '-ascii',
\ 'latin1': '-latin1',
\ 'iso-2022-jp': '-iso-2022',
\ 'cp1252': '-win1252',
\ 'macroman': '-mac',
\ 'utf-16le': '-utf16le',
\ 'utf-16': '-utf16',
\ 'big5': '-big5',
\ 'cp932': '-shiftjis',
\ 'sjis': '-shiftjis',
\ 'cp850': '-ibm858',
\ }
return get(TIDY_OPTS, &fileencoding, '-utf8')
endfunction
let s:IGNORE_ERRORS = [ let s:IGNORE_ERRORS = [
\ "<table> lacks \"summary\" attribute", \ "<table> lacks \"summary\" attribute",
@ -152,29 +139,9 @@ let s:EMPTY_TAGS = [
\ ] \ ]
lockvar! s:EMPTY_TAGS lockvar! s:EMPTY_TAGS
function! s:IgnoreError(text) " }}}1
for item in s:IGNORE_ERRORS + g:syntastic_html_tidy_ignore_errors
if stridx(a:text, item) != -1
return 1
endif
endfor
return 0
endfunction
function! s:NewTags(name) function! SyntaxCheckers_html_tidy_GetLocList() dict " {{{1
return syntastic#util#shescape(join( s:{toupper(a:name)} + g:syntastic_html_tidy_{a:name}, ',' ))
endfunction
function! s:Args()
let args = s:TidyEncOptByFenc() .
\ ' --new-blocklevel-tags ' . s:NewTags('blocklevel_tags') .
\ ' --new-inline-tags ' . s:NewTags('inline_tags') .
\ ' --new-empty-tags ' . s:NewTags('empty_tags') .
\ ' -e'
return args
endfunction
function! SyntaxCheckers_html_tidy_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': s:Args() }) let makeprg = self.makeprgBuild({ 'args_after': s:Args() })
let errorformat = let errorformat =
@ -196,7 +163,52 @@ function! SyntaxCheckers_html_tidy_GetLocList() dict
endfor endfor
return loclist return loclist
endfunction endfunction " }}}1
" Utilities {{{1
" TODO: join this with xhtml.vim for DRY's sake?
function! s:TidyEncOptByFenc() " {{{2
let TIDY_OPTS = {
\ 'utf-8': '-utf8',
\ 'ascii': '-ascii',
\ 'latin1': '-latin1',
\ 'iso-2022-jp': '-iso-2022',
\ 'cp1252': '-win1252',
\ 'macroman': '-mac',
\ 'utf-16le': '-utf16le',
\ 'utf-16': '-utf16',
\ 'big5': '-big5',
\ 'cp932': '-shiftjis',
\ 'sjis': '-shiftjis',
\ 'cp850': '-ibm858',
\ }
return get(TIDY_OPTS, &fileencoding, '-utf8')
endfunction " }}}2
function! s:IgnoreError(text) " {{{2
for item in s:IGNORE_ERRORS + g:syntastic_html_tidy_ignore_errors
if stridx(a:text, item) != -1
return 1
endif
endfor
return 0
endfunction " }}}2
function! s:NewTags(name) " {{{2
return syntastic#util#shescape(join( s:{toupper(a:name)} + g:syntastic_html_tidy_{a:name}, ',' ))
endfunction " }}}2
function! s:Args() " {{{2
let args = s:TidyEncOptByFenc() .
\ ' --new-blocklevel-tags ' . s:NewTags('blocklevel_tags') .
\ ' --new-inline-tags ' . s:NewTags('inline_tags') .
\ ' --new-empty-tags ' . s:NewTags('empty_tags') .
\ ' -e'
return args
endfunction " }}}2
" }}}1
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'html', \ 'filetype': 'html',
@ -205,4 +217,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -66,4 +66,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -59,4 +59,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -74,4 +74,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -18,7 +18,11 @@ let g:syntastic_java_javac_maven_pom_tags = ['build', 'properties']
let g:syntastic_java_javac_maven_pom_properties = {} let g:syntastic_java_javac_maven_pom_properties = {}
let s:has_maven = 0 let s:has_maven = 0
" Global Options let s:save_cpo = &cpo
set cpo&vim
" Checker options {{{1
if !exists('g:syntastic_java_javac_executable') if !exists('g:syntastic_java_javac_executable')
let g:syntastic_java_javac_executable = 'javac' let g:syntastic_java_javac_executable = 'javac'
endif endif
@ -43,13 +47,6 @@ if !exists('g:syntastic_java_javac_delete_output')
let g:syntastic_java_javac_delete_output = 1 let g:syntastic_java_javac_delete_output = 1
endif endif
let s:save_cpo = &cpo
set cpo&vim
function! s:CygwinPath(path)
return substitute(system('cygpath -m ' . syntastic#util#shescape(a:path)), "\n", '', 'g')
endfunction
if !exists('g:syntastic_java_javac_temp_dir') if !exists('g:syntastic_java_javac_temp_dir')
let g:syntastic_java_javac_temp_dir = syntastic#util#tmpdir() let g:syntastic_java_javac_temp_dir = syntastic#util#tmpdir()
endif endif
@ -78,32 +75,144 @@ if !exists('g:syntastic_java_javac_maven_pom_classpath')
let g:syntastic_java_javac_maven_pom_classpath = {} let g:syntastic_java_javac_maven_pom_classpath = {}
endif endif
function! s:RemoveCarriageReturn(line) " }}}1
command! SyntasticJavacEditClasspath call s:EditClasspath()
if g:syntastic_java_javac_config_file_enabled
command! SyntasticJavacEditConfig call s:EditConfig()
endif
function! SyntaxCheckers_java_javac_IsAvailable() dict " {{{1
let s:has_maven = executable(expand(g:syntastic_java_maven_executable, 1))
return executable(expand(g:syntastic_java_javac_executable, 1))
endfunction " }}}1
function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
let javac_opts = g:syntastic_java_javac_options
let output_dir = ''
if g:syntastic_java_javac_delete_output
let output_dir = g:syntastic_java_javac_temp_dir
let javac_opts .= ' -d ' . syntastic#util#shescape(output_dir)
endif
" load classpath from config file
if g:syntastic_java_javac_config_file_enabled
call s:LoadConfigFile()
endif
" add classpathes to javac_classpath {{{2
let javac_classpath = ''
for path in split(g:syntastic_java_javac_classpath, s:ClassSep())
if path != ''
try
let ps = glob(path, 1, 1)
catch
let ps = split(glob(path, 1), "\n")
endtry
if type(ps) == type([])
for p in ps
let javac_classpath = s:AddToClasspath(javac_classpath, p)
endfor
else
let javac_classpath = s:AddToClasspath(javac_classpath, ps)
endif
endif
endfor
if s:has_maven && g:syntastic_java_javac_autoload_maven_classpath
if !g:syntastic_java_javac_delete_output
let javac_opts .= ' -d ' . syntastic#util#shescape(s:MavenOutputDirectory())
endif
let javac_classpath = s:AddToClasspath(javac_classpath, s:GetMavenClasspath())
endif
" }}}2
" load custom classpath {{{2
if g:syntastic_java_javac_custom_classpath_command != ''
let lines = system(g:syntastic_java_javac_custom_classpath_command)
if syntastic#util#isRunningWindows() || has('win32unix')
let lines = substitute(lines, "\r\n", "\n", 'g')
endif
for l in split(lines, "\n")
let javac_classpath = s:AddToClasspath(javac_classpath, l)
endfor
endif
if javac_classpath != ''
let javac_opts .= ' -cp ' . syntastic#util#shexpand(javac_classpath)
endif
" }}}2
let fname = expand('%:p:h', 1) . syntastic#util#Slash() . expand ('%:t', 1)
if has('win32unix')
let fname = s:CygwinPath(fname)
endif
let makeprg = self.makeprgBuild({
\ 'args': javac_opts,
\ 'fname': syntastic#util#shescape(fname) })
" unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types
let errorformat =
\ '%E%f:%l:\ error:\ %m,'.
\ '%W%f:%l:\ warning:\ %m,'.
\ '%A%f:%l:\ %m,'.
\ '%+Z%p^,'.
\ '%+C%.%#,'.
\ '%-G%.%#'
if g:syntastic_java_javac_delete_output
silent! call mkdir(output_dir, 'p')
endif
let errors = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['cygwinRemoveCR'] })
if g:syntastic_java_javac_delete_output
call syntastic#util#rmrf(output_dir)
endif
return errors
endfunction " }}}1
" Utilities {{{1
function! s:CygwinPath(path) " {{{2
return substitute(system('cygpath -m ' . syntastic#util#shescape(a:path)), "\n", '', 'g')
endfunction " }}}2
function! s:RemoveCarriageReturn(line) " {{{2
return substitute(a:line, "\r", '', 'g') return substitute(a:line, "\r", '', 'g')
endfunction endfunction " }}}2
function! s:ClassSep() function! s:ClassSep() " {{{2
return (syntastic#util#isRunningWindows() || has('win32unix')) ? ';' : ':' return (syntastic#util#isRunningWindows() || has('win32unix')) ? ';' : ':'
endfunction endfunction " }}}2
function! s:AddToClasspath(classpath, path) function! s:AddToClasspath(classpath, path) " {{{2
if a:path == '' if a:path == ''
return a:classpath return a:classpath
endif endif
return (a:classpath != '') ? a:classpath . s:ClassSep() . a:path : a:path return (a:classpath != '') ? a:classpath . s:ClassSep() . a:path : a:path
endfunction endfunction " }}}2
function! s:SplitClasspath(classpath) function! s:SplitClasspath(classpath) " {{{2
return split(a:classpath, s:ClassSep()) return split(a:classpath, s:ClassSep())
endfunction endfunction " }}}2
function! s:LoadConfigFile() function! s:LoadConfigFile() " {{{2
if filereadable(expand(g:syntastic_java_javac_config_file, 1)) if filereadable(expand(g:syntastic_java_javac_config_file, 1))
exe 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file, 1)) exe 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file, 1))
endif endif
endfunction endfunction " }}}2
function! s:SaveClasspath() function! s:SaveClasspath() " {{{2
" build classpath from lines " build classpath from lines
let path = '' let path = ''
let lines = getline(1, line('$')) let lines = getline(1, line('$'))
@ -135,9 +244,9 @@ function! s:SaveClasspath()
" set new classpath " set new classpath
let g:syntastic_java_javac_classpath = path let g:syntastic_java_javac_classpath = path
let &modified = 0 let &modified = 0
endfunction endfunction " }}}2
function! s:EditClasspath() function! s:EditClasspath() " {{{2
let command = 'syntastic javac classpath' let command = 'syntastic javac classpath'
let winnr = bufwinnr('^' . command . '$') let winnr = bufwinnr('^' . command . '$')
if winnr < 0 if winnr < 0
@ -160,9 +269,9 @@ function! s:EditClasspath()
else else
execute winnr . 'wincmd w' execute winnr . 'wincmd w'
endif endif
endfunction endfunction " }}}2
function! s:SaveConfig() function! s:SaveConfig() " {{{2
" get lines " get lines
let lines = getline(1, line('$')) let lines = getline(1, line('$'))
if g:syntastic_java_javac_config_file_enabled if g:syntastic_java_javac_config_file_enabled
@ -170,9 +279,9 @@ function! s:SaveConfig()
call writefile(lines, expand(g:syntastic_java_javac_config_file, 1)) call writefile(lines, expand(g:syntastic_java_javac_config_file, 1))
endif endif
let &modified = 0 let &modified = 0
endfunction endfunction " }}}2
function! s:EditConfig() function! s:EditConfig() " {{{2
let command = 'syntastic javac config' let command = 'syntastic javac config'
let winnr = bufwinnr('^' . command . '$') let winnr = bufwinnr('^' . command . '$')
if winnr < 0 if winnr < 0
@ -194,9 +303,9 @@ function! s:EditConfig()
else else
execute winnr . 'wincmd w' execute winnr . 'wincmd w'
endif endif
endfunction endfunction " }}}2
function! s:GetMavenProperties() function! s:GetMavenProperties() " {{{2
let mvn_properties = {} let mvn_properties = {}
let pom = findfile('pom.xml', '.;') let pom = findfile('pom.xml', '.;')
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
@ -230,15 +339,9 @@ function! s:GetMavenProperties()
return g:syntastic_java_javac_maven_pom_properties[pom] return g:syntastic_java_javac_maven_pom_properties[pom]
endif endif
return mvn_properties return mvn_properties
endfunction endfunction " }}}2
command! SyntasticJavacEditClasspath call s:EditClasspath() function! s:GetMavenClasspath() " {{{2
if g:syntastic_java_javac_config_file_enabled
command! SyntasticJavacEditConfig call s:EditConfig()
endif
function! s:GetMavenClasspath()
let pom = findfile('pom.xml', '.;') let pom = findfile('pom.xml', '.;')
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom) if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom)
@ -279,14 +382,9 @@ function! s:GetMavenClasspath()
return g:syntastic_java_javac_maven_pom_classpath[pom] return g:syntastic_java_javac_maven_pom_classpath[pom]
endif endif
return '' return ''
endfunction endfunction " }}}2
function! SyntaxCheckers_java_javac_IsAvailable() dict function! s:MavenOutputDirectory() " {{{2
let s:has_maven = executable(expand(g:syntastic_java_maven_executable, 1))
return executable(expand(g:syntastic_java_javac_executable, 1))
endfunction
function! s:MavenOutputDirectory()
let pom = findfile('pom.xml', '.;') let pom = findfile('pom.xml', '.;')
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
let mvn_properties = s:GetMavenProperties() let mvn_properties = s:GetMavenProperties()
@ -313,97 +411,9 @@ function! s:MavenOutputDirectory()
return output_dir return output_dir
endif endif
return '.' return '.'
endfunction endfunction " }}}2
function! SyntaxCheckers_java_javac_GetLocList() dict " }}}1
let javac_opts = g:syntastic_java_javac_options
let output_dir = ''
if g:syntastic_java_javac_delete_output
let output_dir = g:syntastic_java_javac_temp_dir
let javac_opts .= ' -d ' . syntastic#util#shescape(output_dir)
endif
" load classpath from config file
if g:syntastic_java_javac_config_file_enabled
call s:LoadConfigFile()
endif
let javac_classpath = ''
" add classpathes to javac_classpath
for path in split(g:syntastic_java_javac_classpath, s:ClassSep())
if path != ''
try
let ps = glob(path, 1, 1)
catch
let ps = split(glob(path, 1), "\n")
endtry
if type(ps) == type([])
for p in ps
let javac_classpath = s:AddToClasspath(javac_classpath, p)
endfor
else
let javac_classpath = s:AddToClasspath(javac_classpath, ps)
endif
endif
endfor
if s:has_maven && g:syntastic_java_javac_autoload_maven_classpath
if !g:syntastic_java_javac_delete_output
let javac_opts .= ' -d ' . syntastic#util#shescape(s:MavenOutputDirectory())
endif
let javac_classpath = s:AddToClasspath(javac_classpath, s:GetMavenClasspath())
endif
" load custom classpath
if g:syntastic_java_javac_custom_classpath_command != ''
let lines = system(g:syntastic_java_javac_custom_classpath_command)
if syntastic#util#isRunningWindows() || has('win32unix')
let lines = substitute(lines, "\r\n", "\n", 'g')
endif
for l in split(lines, "\n")
let javac_classpath = s:AddToClasspath(javac_classpath, l)
endfor
endif
if javac_classpath != ''
let javac_opts .= ' -cp ' . syntastic#util#shexpand(javac_classpath)
endif
let fname = expand('%:p:h', 1) . syntastic#util#Slash() . expand ('%:t', 1)
if has('win32unix')
let fname = s:CygwinPath(fname)
endif
let makeprg = self.makeprgBuild({
\ 'args': javac_opts,
\ 'fname': syntastic#util#shescape(fname) })
" unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types
let errorformat =
\ '%E%f:%l:\ error:\ %m,'.
\ '%W%f:%l:\ warning:\ %m,'.
\ '%A%f:%l:\ %m,'.
\ '%+Z%p^,'.
\ '%+C%.%#,'.
\ '%-G%.%#'
if g:syntastic_java_javac_delete_output
silent! call mkdir(output_dir, 'p')
endif
let errors = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['cygwinRemoveCR'] })
if g:syntastic_java_javac_delete_output
call syntastic#util#rmrf(output_dir)
endif
return errors
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'java', \ 'filetype': 'java',
@ -412,4 +422,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -73,4 +73,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -61,4 +61,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -53,4 +53,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -42,4 +42,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -41,4 +41,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -61,4 +61,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -45,4 +45,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -48,4 +48,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -48,4 +48,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -40,4 +40,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -38,4 +38,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -63,4 +63,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -41,4 +41,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -47,4 +47,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -43,4 +43,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -54,4 +54,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -36,4 +36,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -62,4 +62,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -64,4 +64,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -42,4 +42,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -38,4 +38,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -38,4 +38,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,4 +22,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'igor', \ 'name': 'igor',
\ 'redirect': 'docbk/igor'}) \ 'redirect': 'docbk/igor'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -38,4 +38,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -56,4 +56,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -21,4 +21,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'oclint', \ 'name': 'oclint',
\ 'redirect': 'c/oclint'}) \ 'redirect': 'c/oclint'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -56,4 +56,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -21,4 +21,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'oclint', \ 'name': 'oclint',
\ 'redirect': 'c/oclint'}) \ 'redirect': 'c/oclint'})
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -24,9 +24,7 @@ endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict " Checker options {{{1
return executable(s:ocamlpp)
endfunction
if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc') if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc')
let g:syntastic_ocaml_use_ocamlc = 0 let g:syntastic_ocaml_use_ocamlc = 0
@ -40,7 +38,13 @@ if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild")
let g:syntastic_ocaml_use_ocamlbuild = 0 let g:syntastic_ocaml_use_ocamlbuild = 0
endif endif
function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " }}}1
function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict " {{{1
return executable(s:ocamlpp)
endfunction " }}}1
function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
let makeprg = s:GetMakeprg() let makeprg = s:GetMakeprg()
if makeprg == "" if makeprg == ""
return [] return []
@ -58,9 +62,11 @@ function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict
\ '%-G+%.%#' \ '%-G+%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction " }}}1
function! s:GetMakeprg() " Utilities {{{1
function! s:GetMakeprg() " {{{2
if g:syntastic_ocaml_use_ocamlc if g:syntastic_ocaml_use_ocamlc
return s:GetOcamlcMakeprg() return s:GetOcamlcMakeprg()
endif endif
@ -70,9 +76,9 @@ function! s:GetMakeprg()
endif endif
return s:GetOtherMakeprg() return s:GetOtherMakeprg()
endfunction endfunction " }}}2
function! s:GetOcamlcMakeprg() function! s:GetOcamlcMakeprg() " {{{2
if g:syntastic_ocaml_use_janestreet_core if g:syntastic_ocaml_use_janestreet_core
let build_cmd = "ocamlc -I " let build_cmd = "ocamlc -I "
let build_cmd .= expand(g:syntastic_ocaml_janestreet_core_dir, 1) let build_cmd .= expand(g:syntastic_ocaml_janestreet_core_dir, 1)
@ -81,14 +87,14 @@ function! s:GetOcamlcMakeprg()
else else
return "ocamlc -c " . syntastic#util#shexpand('%') return "ocamlc -c " . syntastic#util#shexpand('%')
endif endif
endfunction endfunction " }}}2
function! s:GetOcamlBuildMakeprg() function! s:GetOcamlBuildMakeprg() " {{{2
return "ocamlbuild -quiet -no-log -tag annot," . s:ocamlpp . " -no-links -no-hygiene -no-sanitize " . return "ocamlbuild -quiet -no-log -tag annot," . s:ocamlpp . " -no-links -no-hygiene -no-sanitize " .
\ syntastic#util#shexpand('%:r') . ".cmi" \ syntastic#util#shexpand('%:r') . ".cmi"
endfunction endfunction " }}}2
function! s:GetOtherMakeprg() function! s:GetOtherMakeprg() " {{{2
"TODO: give this function a better name? "TODO: give this function a better name?
" "
"TODO: should use throw/catch instead of returning an empty makeprg "TODO: should use throw/catch instead of returning an empty makeprg
@ -106,7 +112,9 @@ function! s:GetOtherMakeprg()
endif endif
return makeprg return makeprg
endfunction endfunction " }}}2
" }}}1
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ocaml', \ 'filetype': 'ocaml',
@ -115,4 +123,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -96,4 +96,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker:

Some files were not shown because too many files have changed in this diff Show More