mirror of
https://github.com/amix/vimrc
synced 2025-08-09 07:14:59 +08:00
Updated plugins. Added vim-golang as a mode
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
"============================================================================
|
||||
"File: syntastic.vim
|
||||
"Description: Vim plugin for on the fly syntax checking.
|
||||
"Version: 3.4.0-pre
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
@ -19,6 +18,8 @@ if has('reltime')
|
||||
let g:syntastic_start = reltime()
|
||||
endif
|
||||
|
||||
let g:syntastic_version = '3.4.0'
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
||||
for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
|
||||
@ -286,6 +287,7 @@ function! s:CacheErrors(checker_names) " {{{2
|
||||
|
||||
if !s:skipFile()
|
||||
" debug logging {{{3
|
||||
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'version')
|
||||
call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, s:debug_dump_options)
|
||||
call syntastic#log#debugDump(g:SyntasticDebugVariables)
|
||||
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'aggregate_errors')
|
||||
@ -303,17 +305,16 @@ function! s:CacheErrors(checker_names) " {{{2
|
||||
|
||||
let names = []
|
||||
for checker in clist
|
||||
let type = checker.getFiletype()
|
||||
let name = checker.getName()
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . type . '/' . name)
|
||||
let cname = checker.getFiletype() . '/' . checker.getName()
|
||||
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
|
||||
|
||||
let loclist = checker.getLocList()
|
||||
|
||||
if !loclist.isEmpty()
|
||||
if decorate_errors
|
||||
call loclist.decorate(type, name)
|
||||
call loclist.decorate(cname)
|
||||
endif
|
||||
call add(names, [type, name])
|
||||
call add(names, cname)
|
||||
|
||||
let newLoclist = newLoclist.extend(loclist)
|
||||
|
||||
@ -325,13 +326,13 @@ function! s:CacheErrors(checker_names) " {{{2
|
||||
|
||||
" set names {{{3
|
||||
if !empty(names)
|
||||
if len(syntastic#util#unique(map( copy(names), 'v:val[0]' ))) == 1
|
||||
let type = names[0][0]
|
||||
let name = join(map(names, 'v:val[1]'), ', ')
|
||||
if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1
|
||||
let type = substitute(names[0], '\m/.*', '', '')
|
||||
let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ')
|
||||
call newLoclist.setName( name . ' ('. type . ')' )
|
||||
else
|
||||
" checkers from mixed types
|
||||
call newLoclist.setName(join(map(names, 'v:val[0] . "/" . v:val[1]'), ', '))
|
||||
call newLoclist.setName(join(names, ', '))
|
||||
endif
|
||||
endif
|
||||
" }}}3
|
||||
@ -416,13 +417,16 @@ function! SyntasticMake(options) " {{{2
|
||||
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'checker output:', err_lines)
|
||||
|
||||
if has_key(a:options, 'preprocess')
|
||||
if has_key(a:options, 'Preprocess')
|
||||
let err_lines = call(a:options['Preprocess'], [err_lines])
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess (external):', err_lines)
|
||||
elseif has_key(a:options, 'preprocess')
|
||||
let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess:', err_lines)
|
||||
endif
|
||||
lgetexpr err_lines
|
||||
|
||||
let errors = copy(getloclist(0))
|
||||
let errors = deepcopy(getloclist(0))
|
||||
|
||||
if has_key(a:options, 'cwd')
|
||||
execute 'lcd ' . fnameescape(old_cwd)
|
||||
@ -456,7 +460,12 @@ function! SyntasticMake(options) " {{{2
|
||||
call s:addToErrors(errors, { 'subtype': a:options['subtype'] })
|
||||
endif
|
||||
|
||||
if has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
|
||||
if has_key(a:options, 'Postprocess') && !empty(a:options['Postprocess'])
|
||||
for rule in a:options['Postprocess']
|
||||
let errors = call(rule, [errors])
|
||||
endfor
|
||||
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess (external):', errors)
|
||||
elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
|
||||
for rule in a:options['postprocess']
|
||||
let errors = call('syntastic#postprocess#' . rule, [errors])
|
||||
endfor
|
||||
|
Reference in New Issue
Block a user