refactor out some duplication of /dev/null logic
This commit is contained in:
parent
3e58e495ac
commit
0765f97dd3
18
autoload/syntastic/util.vim
Normal file
18
autoload/syntastic/util.vim
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
if exists("g:loaded_syntastic_util_autoload")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_syntastic_util_autoload = 1
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
function! syntastic#util#DevNull()
|
||||||
|
if has('win32')
|
||||||
|
return 'NUL'
|
||||||
|
endif
|
||||||
|
return '/dev/null'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
" vim: set et sts=4 sw=4:
|
@ -42,12 +42,8 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
function! SyntaxCheckers_less_GetLocList()
|
function! SyntaxCheckers_less_GetLocList()
|
||||||
let devnull = '/dev/null'
|
|
||||||
if has('win32')
|
|
||||||
let devnull = 'NUL'
|
|
||||||
endif
|
|
||||||
let makeprg = s:check_file . ' ' . g:syntastic_less_options . ' ' .
|
let makeprg = s:check_file . ' ' . g:syntastic_less_options . ' ' .
|
||||||
\ shellescape(expand('%')) . ' ' . devnull
|
\ shellescape(expand('%')) . ' ' . syntastic#util#DevNull()
|
||||||
let errorformat = '%m in %f:%l:%c'
|
let errorformat = '%m in %f:%l:%c'
|
||||||
|
|
||||||
return SyntasticMake({ 'makeprg': makeprg,
|
return SyntasticMake({ 'makeprg': makeprg,
|
||||||
|
@ -24,12 +24,8 @@ if !executable("rst2pseudoxml.py")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_rst_GetLocList()
|
function! SyntaxCheckers_rst_GetLocList()
|
||||||
let devnull = '/dev/null'
|
|
||||||
if has('win32')
|
|
||||||
let devnull = 'NUL'
|
|
||||||
endif
|
|
||||||
let makeprg = 'rst2pseudoxml.py --report=2 --exit-status=1 ' .
|
let makeprg = 'rst2pseudoxml.py --report=2 --exit-status=1 ' .
|
||||||
\ shellescape(expand('%')) . ' ' . devnull
|
\ shellescape(expand('%')) . ' ' . syntastic#util#DevNull()
|
||||||
|
|
||||||
let errorformat = '%f:%l:\ (%tNFO/1)\ %m,
|
let errorformat = '%f:%l:\ (%tNFO/1)\ %m,
|
||||||
\%f:%l:\ (%tARNING/2)\ %m,
|
\%f:%l:\ (%tARNING/2)\ %m,
|
||||||
|
@ -14,11 +14,7 @@ if !executable("tsc")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_typescript_GetLocList()
|
function! SyntaxCheckers_typescript_GetLocList()
|
||||||
let devnull = '/dev/null'
|
let makeprg = 'tsc ' . shellescape(expand("%")) . ' --out ' . syntastic#util#DevNull()
|
||||||
if has('win32')
|
|
||||||
let devnull = 'NUL'
|
|
||||||
endif
|
|
||||||
let makeprg = 'tsc ' . shellescape(expand("%")) . ' --out ' . devnull
|
|
||||||
let errorformat = '%f (%l\,%c): %m'
|
let errorformat = '%f (%l\,%c): %m'
|
||||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user