Cleanup for the new aggregate_errors.

This commit is contained in:
LCD 47 2014-04-19 09:09:48 +03:00
parent 99cbe5d011
commit 177292cafa
3 changed files with 13 additions and 16 deletions

View File

@ -288,10 +288,12 @@ to label error messages with the names of the checkers that created them. >
<
*'syntastic_sort_aggregated_errors'*
Default: 1
By default, when |syntastic_aggregate_errors| is enabled, errors are grouped
by file, then sorted by line number, then grouped by type (namely, errors take
precedence over warnings), then they are sorted by column number. If you want
to leave messages grouped by checker output, set this variable to 0. >
By default, when results from multiple checkers are aggregated in a single
error list (that is either when |syntastic_aggregate_errors| is enabled, or
when checking a file with a composite filetype), errors are grouped by file,
then sorted by line number, then grouped by type (namely errors take precedence
over warnings), then they are sorted by column number. If you want to leave
messages grouped by checker output, set this variable to 0. >
let g:syntastic_sort_aggregated_errors = 0
<
*'syntastic_echo_current_error'*

View File

@ -18,7 +18,7 @@ if has('reltime')
let g:syntastic_start = reltime()
endif
let g:syntastic_version = '3.4.0-34'
let g:syntastic_version = '3.4.0-35'
" Sanity checks {{{1
@ -296,8 +296,8 @@ function! s:CacheErrors(checker_names) " {{{2
" }}}3
let filetypes = s:resolveFiletypes()
let aggregate_errors = syntastic#util#var('aggregate_errors')
let decorate_errors = (aggregate_errors || len(filetypes) > 1) && syntastic#util#var('id_checkers')
let aggregate_errors = syntastic#util#var('aggregate_errors') || len(filetypes) > 1
let decorate_errors = aggregate_errors && syntastic#util#var('id_checkers')
let sort_aggregated_errors = aggregate_errors && syntastic#util#var('sort_aggregated_errors')
let clist = []
@ -317,6 +317,10 @@ function! s:CacheErrors(checker_names) " {{{2
call loclist.decorate(cname)
endif
call add(names, cname)
if checker.getWantSort() && !sort_aggregated_errors
call loclist.sort()
call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', loclist)
endif
let newLoclist = newLoclist.extend(loclist)

View File

@ -69,7 +69,6 @@ function! g:SyntasticChecker.getLocListRaw() " {{{2
call self._populateHighlightRegexes(list)
call syntastic#log#debug(g:SyntasticDebugLoclist, name . ' raw:', list)
call self._quietMessages(list)
call self._sortMessages(list)
return list
endfunction " }}}2
@ -131,14 +130,6 @@ function! g:SyntasticChecker._quietMessages(errors) " {{{2
endif
endfunction " }}}2
function! g:SyntasticChecker._sortMessages(errors) " {{{2
" don't sort now if we're going to sort the aggregated list later
if self._sort && !(syntastic#util#var('aggregate_errors') && syntastic#util#var('sort_aggregated_errors'))
call syntastic#util#sortLoclist(a:errors)
call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', a:errors)
endif
endfunction " }}}2
function! g:SyntasticChecker._populateHighlightRegexes(errors) " {{{2
if has_key(self, '_highlightRegexFunc')
for e in a:errors