From 177292cafa6cbe0b9212906910beb8a3785b945d Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Sat, 19 Apr 2014 09:09:48 +0300 Subject: [PATCH] Cleanup for the new aggregate_errors. --- doc/syntastic.txt | 10 ++++++---- plugin/syntastic.vim | 10 +++++++--- plugin/syntastic/checker.vim | 9 --------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/doc/syntastic.txt b/doc/syntastic.txt index fd0fb2b9..14f188f0 100644 --- a/doc/syntastic.txt +++ b/doc/syntastic.txt @@ -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'* diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 39b22805..8053d92e 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.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) diff --git a/plugin/syntastic/checker.vim b/plugin/syntastic/checker.vim index e93291ba..33da5663 100644 --- a/plugin/syntastic/checker.vim +++ b/plugin/syntastic/checker.vim @@ -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