Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcd047 committed Mar 10, 2014
1 parent da6520c commit 2850d41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
21 changes: 10 additions & 11 deletions plugin/syntastic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions plugin/syntastic/loclist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2850d41

Please sign in to comment.