mirror of
https://github.com/amix/vimrc
synced 2025-07-21 11:54:59 +08:00
merge
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_eruby_ruby_checker")
|
||||
if exists('g:loaded_syntastic_eruby_ruby_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_eruby_ruby_checker = 1
|
||||
@ -27,11 +27,16 @@ function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
||||
let fname = "'" . escape(expand('%'), "\\'") . "'"
|
||||
if !exists('s:ruby_new')
|
||||
let s:ruby_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 9])
|
||||
endif
|
||||
|
||||
let buf = bufnr('')
|
||||
let fname = "'" . escape(bufname(buf), "\\'") . "'"
|
||||
|
||||
" TODO: encodings became useful in ruby 1.9 :)
|
||||
if syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped(). ' --version'), [1, 9])
|
||||
let enc = &fileencoding != '' ? &fileencoding : &encoding
|
||||
if s:ruby_new
|
||||
let enc = &fileencoding !=# '' ? &fileencoding : &encoding
|
||||
let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
|
||||
else
|
||||
let encoding_spec = ''
|
||||
@ -65,7 +70,7 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'env': env,
|
||||
\ 'defaults': { 'bufnr': bufnr(""), 'vcol': 1 } })
|
||||
\ 'defaults': { 'bufnr': buf, 'vcol': 1 } })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
@ -75,4 +80,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
Reference in New Issue
Block a user