Skip to content

Commit 2850d41

Browse files
committed
Minor cleanup.
1 parent da6520c commit 2850d41

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

plugin/syntastic.vim

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if has('reltime')
1818
let g:syntastic_start = reltime()
1919
endif
2020

21-
let g:syntastic_version = '3.3.0-121'
21+
let g:syntastic_version = '3.3.0-122'
2222

2323
" Sanity checks {{{1
2424

@@ -305,17 +305,16 @@ function! s:CacheErrors(checker_names) " {{{2
305305

306306
let names = []
307307
for checker in clist
308-
let type = checker.getFiletype()
309-
let name = checker.getName()
310-
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . type . '/' . name)
308+
let cname = checker.getFiletype() . '/' . checker.getName()
309+
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
311310

312311
let loclist = checker.getLocList()
313312

314313
if !loclist.isEmpty()
315314
if decorate_errors
316-
call loclist.decorate(type, name)
315+
call loclist.decorate(cname)
317316
endif
318-
call add(names, [type, name])
317+
call add(names, cname)
319318

320319
let newLoclist = newLoclist.extend(loclist)
321320

@@ -327,13 +326,13 @@ function! s:CacheErrors(checker_names) " {{{2
327326

328327
" set names {{{3
329328
if !empty(names)
330-
if len(syntastic#util#unique(map( copy(names), 'v:val[0]' ))) == 1
331-
let type = names[0][0]
332-
let name = join(map(names, 'v:val[1]'), ', ')
329+
if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1
330+
let type = substitute(names[0], '\m/.*', '', '')
331+
let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ')
333332
call newLoclist.setName( name . ' ('. type . ')' )
334333
else
335334
" checkers from mixed types
336-
call newLoclist.setName(join(map(names, 'v:val[0] . "/" . v:val[1]'), ', '))
335+
call newLoclist.setName(join(names, ', '))
337336
endif
338337
endif
339338
" }}}3
@@ -427,7 +426,7 @@ function! SyntasticMake(options) " {{{2
427426
endif
428427
lgetexpr err_lines
429428

430-
let errors = copy(getloclist(0))
429+
let errors = deepcopy(getloclist(0))
431430

432431
if has_key(a:options, 'cwd')
433432
execute 'lcd ' . fnameescape(old_cwd)

plugin/syntastic/loclist.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ function! g:SyntasticLoclist.setName(name) " {{{2
114114
let self._name = a:name
115115
endfunction " }}}2
116116

117-
function! g:SyntasticLoclist.decorate(filetype, name) " {{{2
117+
function! g:SyntasticLoclist.decorate(tag) " {{{2
118118
for e in self._rawLoclist
119-
let e['text'] .= ' [' . a:filetype . '/' . a:name . ']'
119+
let e['text'] .= ' [' . a:tag . ']'
120120
endfor
121121
endfunction " }}}2
122122

0 commit comments

Comments
 (0)