Cleanup.
This commit is contained in:
parent
552078320c
commit
8aa2a6f4c1
@ -165,7 +165,7 @@ augroup syntastic
|
|||||||
|
|
||||||
autocmd BufWinEnter * call s:BufWinEnterHook()
|
autocmd BufWinEnter * call s:BufWinEnterHook()
|
||||||
|
|
||||||
" TODO: the next autocmd should be "autocmd BufWinLeave * if empty(&buftype) | lclose | endif"
|
" TODO: the next autocmd should be "autocmd BufWinLeave * if &buftype == '' | lclose | endif"
|
||||||
" but in recent versions of Vim lclose can no longer be called from BufWinLeave
|
" but in recent versions of Vim lclose can no longer be called from BufWinLeave
|
||||||
autocmd BufEnter * call s:BufEnterHook()
|
autocmd BufEnter * call s:BufEnterHook()
|
||||||
augroup END
|
augroup END
|
||||||
@ -196,7 +196,7 @@ function! s:BufWinEnterHook()
|
|||||||
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
call syntastic#log#debug(g:SyntasticDebugAutocommands,
|
||||||
\ 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
|
\ 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
|
||||||
\ ', &buftype = ' . string(&buftype))
|
\ ', &buftype = ' . string(&buftype))
|
||||||
if empty(&buftype)
|
if &buftype == ''
|
||||||
let loclist = g:SyntasticLoclist.current()
|
let loclist = g:SyntasticLoclist.current()
|
||||||
call s:notifiers.refresh(loclist)
|
call s:notifiers.refresh(loclist)
|
||||||
endif
|
endif
|
||||||
@ -386,7 +386,7 @@ endfunction
|
|||||||
function! s:SkipFile()
|
function! s:SkipFile()
|
||||||
let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
|
let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
|
||||||
let fname = expand('%')
|
let fname = expand('%')
|
||||||
return force_skip || !empty(&buftype) || !filereadable(fname) || getwinvar(0, '&diff') || s:IgnoreFile(fname)
|
return force_skip || (&buftype != '') || !filereadable(fname) || getwinvar(0, '&diff') || s:IgnoreFile(fname)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:uname()
|
function! s:uname()
|
||||||
|
@ -31,8 +31,6 @@ function! g:SyntasticChecker.New(args)
|
|||||||
|
|
||||||
if exists('*' . prefix . 'GetHighlightRegex')
|
if exists('*' . prefix . 'GetHighlightRegex')
|
||||||
let newObj._highlightRegexFunc = function(prefix . 'GetHighlightRegex')
|
let newObj._highlightRegexFunc = function(prefix . 'GetHighlightRegex')
|
||||||
else
|
|
||||||
let newObj._highlightRegexFunc = ''
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return newObj
|
return newObj
|
||||||
@ -73,10 +71,6 @@ function! g:SyntasticChecker.getLocList()
|
|||||||
return g:SyntasticLoclist.New(self.getLocListRaw())
|
return g:SyntasticLoclist.New(self.getLocListRaw())
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! g:SyntasticChecker.getHighlightRegexFor(error)
|
|
||||||
return empty(self._highlightRegexFunc) ? [] : self._highlightRegexFunc(a:error)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! g:SyntasticChecker.makeprgBuild(opts)
|
function! g:SyntasticChecker.makeprgBuild(opts)
|
||||||
let setting = 'g:syntastic_' . self._filetype . '_' . self._name . '_'
|
let setting = 'g:syntastic_' . self._filetype . '_' . self._name . '_'
|
||||||
|
|
||||||
@ -86,7 +80,7 @@ function! g:SyntasticChecker.makeprgBuild(opts)
|
|||||||
call extend(parts, self._getOpt(a:opts, setting, 'post_args', ''))
|
call extend(parts, self._getOpt(a:opts, setting, 'post_args', ''))
|
||||||
call extend(parts, self._getOpt(a:opts, setting, 'tail', ''))
|
call extend(parts, self._getOpt(a:opts, setting, 'tail', ''))
|
||||||
|
|
||||||
return join(filter(parts, 'strlen(v:val)'))
|
return join(filter(parts, 'v:val != ""'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! g:SyntasticChecker.isAvailable()
|
function! g:SyntasticChecker.isAvailable()
|
||||||
@ -104,7 +98,7 @@ function! g:SyntasticChecker._quietMessages(errors)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! g:SyntasticChecker._populateHighlightRegexes(errors)
|
function! g:SyntasticChecker._populateHighlightRegexes(errors)
|
||||||
if !empty(self._highlightRegexFunc)
|
if has_key(self, '_highlightRegexFunc')
|
||||||
for e in a:errors
|
for e in a:errors
|
||||||
if e['valid']
|
if e['valid']
|
||||||
let term = self._highlightRegexFunc(e)
|
let term = self._highlightRegexFunc(e)
|
||||||
|
@ -13,7 +13,7 @@ function! g:SyntasticLoclist.New(rawLoclist)
|
|||||||
let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
|
let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
|
||||||
|
|
||||||
for e in llist
|
for e in llist
|
||||||
if empty(e['type'])
|
if get(e, 'type', '') == ''
|
||||||
let e['type'] = 'E'
|
let e['type'] = 'E'
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
@ -41,12 +41,12 @@ function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return strlen(term) ? '\V\<' . term . '\>' : ''
|
return term != '' ? '\V\<' . term . '\>' : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
|
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'args_before': (strlen(g:syntastic_actionscript_mxmlc_conf) ?
|
\ 'args_before': (g:syntastic_actionscript_mxmlc_conf != '' ?
|
||||||
\ ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : ''),
|
\ ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : ''),
|
||||||
\ 'args_after': '-output=' . syntastic#util#DevNull() })
|
\ 'args_after': '-output=' . syntastic#util#DevNull() })
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict
|
|||||||
endif
|
endif
|
||||||
let hxml = fnamemodify(hxml, ':p')
|
let hxml = fnamemodify(hxml, ':p')
|
||||||
|
|
||||||
if !empty(hxml)
|
if hxml != ''
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))) })
|
\ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))) })
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ endfunction
|
|||||||
function! SyntaxCheckers_html_jshint_GetLocList() dict
|
function! SyntaxCheckers_html_jshint_GetLocList() dict
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'exe': expand(g:syntastic_jshint_exec),
|
\ 'exe': expand(g:syntastic_jshint_exec),
|
||||||
\ 'args': (!empty(g:syntastic_html_jshint_conf) ? ' --config ' . g:syntastic_html_jshint_conf : ''),
|
\ 'args': (g:syntastic_html_jshint_conf != '' ? '--config ' . g:syntastic_html_jshint_conf : ''),
|
||||||
\ 'args_after': '--verbose --extract always' })
|
\ 'args_after': '--verbose --extract always' })
|
||||||
|
|
||||||
let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'
|
let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'
|
||||||
|
@ -66,8 +66,8 @@ endfunction
|
|||||||
function! SyntaxCheckers_html_validator_GetLocList() dict
|
function! SyntaxCheckers_html_validator_GetLocList() dict
|
||||||
let fname = syntastic#util#shexpand('%')
|
let fname = syntastic#util#shexpand('%')
|
||||||
let makeprg = self.getExec() . ' -s --compressed -F out=gnu -F asciiquotes=yes' .
|
let makeprg = self.getExec() . ' -s --compressed -F out=gnu -F asciiquotes=yes' .
|
||||||
\ (!empty(g:syntastic_html_validator_parser) ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
\ (g:syntastic_html_validator_parser != '' ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
||||||
\ (!empty(g:syntastic_html_validator_nsfilter) ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
\ (g:syntastic_html_validator_nsfilter != '' ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
||||||
\ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api
|
\ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
|
@ -23,7 +23,7 @@ set cpo&vim
|
|||||||
|
|
||||||
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'args': strlen(g:syntastic_javascript_eslint_conf) ? ' --config ' . g:syntastic_javascript_eslint_conf : '' })
|
\ 'args': (g:syntastic_javascript_eslint_conf != '' ? '--config ' . g:syntastic_javascript_eslint_conf : '') })
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
\ '%E%f: line %l\, col %c\, Error - %m'
|
\ '%E%f: line %l\, col %c\, Error - %m'
|
||||||
|
@ -37,7 +37,7 @@ function! SyntaxCheckers_javascript_jshint_GetLocList() dict
|
|||||||
|
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'exe': expand(g:syntastic_jshint_exec),
|
\ 'exe': expand(g:syntastic_jshint_exec),
|
||||||
\ 'args': (strlen(g:syntastic_javascript_jshint_conf) ? '--config ' . g:syntastic_javascript_jshint_conf : ''),
|
\ 'args': (g:syntastic_javascript_jshint_conf != '' ? '--config ' . g:syntastic_javascript_jshint_conf : ''),
|
||||||
\ 'args_after': (s:jshint_new ? '--verbose ' : '') })
|
\ 'args_after': (s:jshint_new ? '--verbose ' : '') })
|
||||||
|
|
||||||
let errorformat = s:jshint_new ?
|
let errorformat = s:jshint_new ?
|
||||||
|
@ -23,7 +23,7 @@ set cpo&vim
|
|||||||
|
|
||||||
function! SyntaxCheckers_javascript_jsl_GetLocList() dict
|
function! SyntaxCheckers_javascript_jsl_GetLocList() dict
|
||||||
let makeprg = self.makeprgBuild({
|
let makeprg = self.makeprgBuild({
|
||||||
\ 'args': (strlen(g:syntastic_javascript_jsl_conf) ? '-conf ' . g:syntastic_javascript_jsl_conf : ''),
|
\ 'args': (g:syntastic_javascript_jsl_conf != '' ? '-conf ' . g:syntastic_javascript_jsl_conf : ''),
|
||||||
\ 'args_after': '-nologo -nofilelisting -nosummary -nocontext -process' })
|
\ 'args_after': '-nologo -nofilelisting -nosummary -nocontext -process' })
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
|
@ -19,7 +19,7 @@ let s:save_cpo = &cpo
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
function! SyntaxCheckers_limbo_limbo_GetLocList() dict
|
function! SyntaxCheckers_limbo_limbo_GetLocList() dict
|
||||||
let include = !empty($INFERNO_HOME) ? '-I$INFERNO_HOME ' : ''
|
let include = $INFERNO_HOME != '' ? '-I$INFERNO_HOME ' : ''
|
||||||
" don't generate .dis in current dir while checking syntax,
|
" don't generate .dis in current dir while checking syntax,
|
||||||
" .dis should be generated by `mk`
|
" .dis should be generated by `mk`
|
||||||
let output = filereadable('mkfile') ? (' ' . syntastic#c#NullOutput()) : ''
|
let output = filereadable('mkfile') ? (' ' . syntastic#c#NullOutput()) : ''
|
||||||
|
@ -21,7 +21,7 @@ set cpo&vim
|
|||||||
function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
||||||
let result = ''
|
let result = ''
|
||||||
let near = matchstr(a:pos['text'], '\mnear ''\zs[^'']\+\ze''')
|
let near = matchstr(a:pos['text'], '\mnear ''\zs[^'']\+\ze''')
|
||||||
if strlen(near) > 0
|
if near != ''
|
||||||
if near ==# '<eof>'
|
if near ==# '<eof>'
|
||||||
let p = getpos('$')
|
let p = getpos('$')
|
||||||
let a:pos['lnum'] = p[1]
|
let a:pos['lnum'] = p[1]
|
||||||
@ -35,7 +35,7 @@ function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
|||||||
" in future versions of syntastic; enable it at your own risk :)
|
" in future versions of syntastic; enable it at your own risk :)
|
||||||
|
|
||||||
"let open = matchstr(a:pos['text'], '\m(to close ''\zs[^'']\+\ze'' at line [0-9]\+)')
|
"let open = matchstr(a:pos['text'], '\m(to close ''\zs[^'']\+\ze'' at line [0-9]\+)')
|
||||||
"if strlen(open) > 0
|
"if open != ''
|
||||||
" let line = str2nr(matchstr(a:pos['text'], '\m(to close ''[^'']\+'' at line \zs[0-9]\+\ze)'))
|
" let line = str2nr(matchstr(a:pos['text'], '\m(to close ''[^'']\+'' at line \zs[0-9]\+\ze)'))
|
||||||
" let group = a:pos['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning'
|
" let group = a:pos['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning'
|
||||||
" call matchadd(group, '\%' . line . 'l\V' . open)
|
" call matchadd(group, '\%' . line . 'l\V' . open)
|
||||||
|
@ -20,7 +20,7 @@ set cpo&vim
|
|||||||
|
|
||||||
function! SyntaxCheckers_po_msgfmt_GetHighlightRegex(item)
|
function! SyntaxCheckers_po_msgfmt_GetHighlightRegex(item)
|
||||||
let term = matchstr(a:item['text'], '\mkeyword "\zs[^"]\+\ze" unknown')
|
let term = matchstr(a:item['text'], '\mkeyword "\zs[^"]\+\ze" unknown')
|
||||||
return !empty(term) ? '\V' . term : ''
|
return term != '' ? '\V' . term : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SyntaxCheckers_po_msgfmt_GetLocList() dict
|
function! SyntaxCheckers_po_msgfmt_GetLocList() dict
|
||||||
|
@ -22,7 +22,7 @@ function! s:GetShell()
|
|||||||
if !exists('b:shell') || b:shell == ''
|
if !exists('b:shell') || b:shell == ''
|
||||||
let b:shell = ''
|
let b:shell = ''
|
||||||
let shebang = getbufline(bufnr('%'), 1)[0]
|
let shebang = getbufline(bufnr('%'), 1)[0]
|
||||||
if strlen(shebang) > 0
|
if shebang != ''
|
||||||
if stridx(shebang, 'bash') >= 0
|
if stridx(shebang, 'bash') >= 0
|
||||||
let b:shell = 'bash'
|
let b:shell = 'bash'
|
||||||
elseif stridx(shebang, 'zsh') >= 0
|
elseif stridx(shebang, 'zsh') >= 0
|
||||||
|
@ -36,8 +36,8 @@ let s:save_cpo = &cpo
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos)
|
function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos)
|
||||||
let strlength = strlen(matchstr(a:pos['text'], '\m\^\+$'))
|
let length = strlen(matchstr(a:pos['text'], '\m\^\+$'))
|
||||||
return '\%>' . (a:pos.col-1) . 'c.*\%<' . (a:pos.col+strlength+1) . 'c'
|
return '\%>' . (a:pos['col'] - 1) . 'c.*\%<' . (a:pos['col'] + length + 1) . 'c'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:GetValaModules()
|
function! s:GetValaModules()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user