From 2850d4145a48e1640c3b73b81ffe019736683860 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Mon, 10 Mar 2014 15:50:58 +0200 Subject: [PATCH] Minor cleanup. --- plugin/syntastic.vim | 21 ++++++++++----------- plugin/syntastic/loclist.vim | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 7abb5b00..0e74ff92 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -18,7 +18,7 @@ if has('reltime') let g:syntastic_start = reltime() endif -let g:syntastic_version = '3.3.0-121' +let g:syntastic_version = '3.3.0-122' " Sanity checks {{{1 @@ -305,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) @@ -327,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 @@ -427,7 +426,7 @@ function! SyntasticMake(options) " {{{2 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) diff --git a/plugin/syntastic/loclist.vim b/plugin/syntastic/loclist.vim index f95173b5..3d3a649e 100644 --- a/plugin/syntastic/loclist.vim +++ b/plugin/syntastic/loclist.vim @@ -114,9 +114,9 @@ function! g:SyntasticLoclist.setName(name) " {{{2 let self._name = a:name endfunction " }}}2 -function! g:SyntasticLoclist.decorate(filetype, name) " {{{2 +function! g:SyntasticLoclist.decorate(tag) " {{{2 for e in self._rawLoclist - let e['text'] .= ' [' . a:filetype . '/' . a:name . ']' + let e['text'] .= ' [' . a:tag . ']' endfor endfunction " }}}2