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
|
||||
|
||||
function! SyntaxCheckers_less_GetLocList()
|
||||
let devnull = '/dev/null'
|
||||
if has('win32')
|
||||
let devnull = 'NUL'
|
||||
endif
|
||||
let makeprg = s:check_file . ' ' . g:syntastic_less_options . ' ' .
|
||||
\ shellescape(expand('%')) . ' ' . devnull
|
||||
\ shellescape(expand('%')) . ' ' . syntastic#util#DevNull()
|
||||
let errorformat = '%m in %f:%l:%c'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg,
|
||||
|
@ -24,12 +24,8 @@ if !executable("rst2pseudoxml.py")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_rst_GetLocList()
|
||||
let devnull = '/dev/null'
|
||||
if has('win32')
|
||||
let devnull = 'NUL'
|
||||
endif
|
||||
let makeprg = 'rst2pseudoxml.py --report=2 --exit-status=1 ' .
|
||||
\ shellescape(expand('%')) . ' ' . devnull
|
||||
\ shellescape(expand('%')) . ' ' . syntastic#util#DevNull()
|
||||
|
||||
let errorformat = '%f:%l:\ (%tNFO/1)\ %m,
|
||||
\%f:%l:\ (%tARNING/2)\ %m,
|
||||
|
@ -14,11 +14,7 @@ if !executable("tsc")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_typescript_GetLocList()
|
||||
let devnull = '/dev/null'
|
||||
if has('win32')
|
||||
let devnull = 'NUL'
|
||||
endif
|
||||
let makeprg = 'tsc ' . shellescape(expand("%")) . ' --out ' . devnull
|
||||
let makeprg = 'tsc ' . shellescape(expand("%")) . ' --out ' . syntastic#util#DevNull()
|
||||
let errorformat = '%f (%l\,%c): %m'
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
Loading…
x
Reference in New Issue
Block a user