Minor cleanup.

This commit is contained in:
LCD 47 2016-10-04 23:10:32 +03:00
parent 9648145ab1
commit ee4f39a67d
5 changed files with 16 additions and 11 deletions

View File

@ -68,7 +68,7 @@ function! syntastic#log#debug(level, msg, ...) abort " {{{2
let leader = s:_log_timestamp() let leader = s:_log_timestamp()
call s:_logRedirect(1) call s:_logRedirect(1)
if a:0 > 0 if a:0
" filter out dictionary functions " filter out dictionary functions
echomsg leader . a:msg . ' ' . echomsg leader . a:msg . ' ' .
\ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ? \ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ?

View File

@ -132,7 +132,7 @@ endfunction " }}}2
" Get the value of a Vim variable. Allow buffer variables to override global ones. " Get the value of a Vim variable. Allow buffer variables to override global ones.
function! syntastic#util#bufRawVar(buf, name, ...) abort " {{{2 function! syntastic#util#bufRawVar(buf, name, ...) abort " {{{2
return s:_getbufvar(a:buf, a:name, get(g:, a:name, a:0 > 0 ? a:1 : '')) return s:_getbufvar(a:buf, a:name, get(g:, a:name, a:0 ? a:1 : ''))
endfunction "}}}2 endfunction "}}}2
" Get the value of a syntastic variable. Allow buffer variables to override global ones. " Get the value of a syntastic variable. Allow buffer variables to override global ones.
@ -142,7 +142,7 @@ endfunction "}}}2
" Get the value of a Vim variable. Allow local variables to override global ones. " Get the value of a Vim variable. Allow local variables to override global ones.
function! syntastic#util#rawVar(name, ...) abort " {{{2 function! syntastic#util#rawVar(name, ...) abort " {{{2
return get(b:, a:name, get(g:, a:name, a:0 > 0 ? a:1 : '')) return get(b:, a:name, get(g:, a:name, a:0 ? a:1 : ''))
endfunction " }}}2 endfunction " }}}2
" Get the value of a syntastic variable. Allow local variables to override global ones. " Get the value of a syntastic variable. Allow local variables to override global ones.
@ -588,7 +588,7 @@ lockvar s:_float2str
function! s:_getbufvar_dumb(buf, name, ...) abort " {{{2 function! s:_getbufvar_dumb(buf, name, ...) abort " {{{2
let ret = getbufvar(a:buf, a:name) let ret = getbufvar(a:buf, a:name)
if a:0 > 0 && ret ==# '' if a:0 && ret ==# ''
unlet! ret unlet! ret
let ret = a:1 let ret = a:1
endif endif

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-227' let g:_SYNTASTIC_VERSION = '3.7.0-228'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View File

@ -68,10 +68,15 @@ endfunction " }}}2
" getExec() or getExecEscaped(). Normally isAvailable() does that for you " getExec() or getExecEscaped(). Normally isAvailable() does that for you
" automatically, but you should keep still this in mind if you change the " automatically, but you should keep still this in mind if you change the
" current checker workflow. " current checker workflow.
function! g:SyntasticChecker.syncExec() abort " {{{2 function! g:SyntasticChecker.syncExec(...) abort " {{{2
if a:0
let self._exec = a:1
else
let suffix = self._name . '_exec' let suffix = self._name . '_exec'
let user_exec = expand( syntastic#util#var(self._filetype . '_' . suffix, syntastic#util#var(suffix)), 1 ) let self._exec = expand(
let self._exec = user_exec !=# '' ? user_exec : self._exec_default \ syntastic#util#var(self._filetype . '_' . suffix,
\ syntastic#util#var(suffix, self._exec_default)), 1 )
endif
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticChecker.getExec() abort " {{{2 function! g:SyntasticChecker.getExec() abort " {{{2
@ -157,7 +162,7 @@ endfunction " }}}2
function! g:SyntasticChecker.log(msg, ...) abort " {{{2 function! g:SyntasticChecker.log(msg, ...) abort " {{{2
let leader = self._filetype . '/' . self._name . ': ' let leader = self._filetype . '/' . self._name . ': '
if a:0 > 0 if a:0
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg, a:1) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg, a:1)
else else
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg)

View File

@ -28,7 +28,7 @@ function! g:SyntasticLoclist.New(rawLoclist) abort " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticLoclist.current(...) abort " {{{2 function! g:SyntasticLoclist.current(...) abort " {{{2
let buf = a:0 > 1 ? a:1 : bufnr('') let buf = a:0 ? a:1 : bufnr('')
let loclist = syntastic#util#getbufvar(buf, 'syntastic_loclist', {}) let loclist = syntastic#util#getbufvar(buf, 'syntastic_loclist', {})
if type(loclist) != type({}) || empty(loclist) if type(loclist) != type({}) || empty(loclist)
unlet! loclist unlet! loclist