Minor cleanup.

This commit is contained in:
LCD 47 2013-11-19 09:35:16 +02:00
parent cfe2ac68a4
commit 4cc0b119c0
2 changed files with 30 additions and 32 deletions

View File

@ -10,6 +10,33 @@ if !exists("g:syntastic_debug")
let g:syntastic_debug = 0 let g:syntastic_debug = 0
endif endif
let s:global_options = [
\ 'syntastic_aggregate_errors',
\ 'syntastic_always_populate_loc_list',
\ 'syntastic_auto_jump',
\ 'syntastic_auto_loc_list',
\ 'syntastic_check_on_open',
\ 'syntastic_check_on_wq',
\ 'syntastic_debug',
\ 'syntastic_delayed_redraws',
\ 'syntastic_echo_current_error',
\ 'syntastic_enable_balloons',
\ 'syntastic_enable_highlighting',
\ 'syntastic_enable_signs',
\ 'syntastic_error_symbol',
\ 'syntastic_filetype_map',
\ 'syntastic_full_redraws',
\ 'syntastic_id_checkers',
\ 'syntastic_ignore_files',
\ 'syntastic_loc_list_height',
\ 'syntastic_mode_map',
\ 'syntastic_quiet_warnings',
\ 'syntastic_reuse_loc_lists',
\ 'syntastic_stl_format',
\ 'syntastic_style_error_symbol',
\ 'syntastic_style_warning_symbol',
\ 'syntastic_warning_symbol' ]
let s:deprecation_notices_issued = [] let s:deprecation_notices_issued = []
" Public functions {{{1 " Public functions {{{1
@ -97,34 +124,7 @@ function! syntastic#log#debugDump(level)
return return
endif endif
let vars = [ call syntastic#log#debugShowVariables(a:level, s:global_options)
\ 'syntastic_aggregate_errors',
\ 'syntastic_always_populate_loc_list',
\ 'syntastic_auto_jump',
\ 'syntastic_auto_loc_list',
\ 'syntastic_check_on_open',
\ 'syntastic_check_on_wq',
\ 'syntastic_debug',
\ 'syntastic_delayed_redraws',
\ 'syntastic_echo_current_error',
\ 'syntastic_enable_balloons',
\ 'syntastic_enable_highlighting',
\ 'syntastic_enable_signs',
\ 'syntastic_error_symbol',
\ 'syntastic_filetype_map',
\ 'syntastic_full_redraws',
\ 'syntastic_id_checkers',
\ 'syntastic_ignore_files',
\ 'syntastic_loc_list_height',
\ 'syntastic_mode_map',
\ 'syntastic_quiet_warnings',
\ 'syntastic_reuse_loc_lists',
\ 'syntastic_stl_format',
\ 'syntastic_style_error_symbol',
\ 'syntastic_style_warning_symbol',
\ 'syntastic_warning_symbol' ]
call syntastic#log#debugShowVariables(a:level, vars)
endfunction endfunction
" Private functions {{{1 " Private functions {{{1

View File

@ -11,8 +11,7 @@ function! g:SyntasticLoclist.New(rawLoclist)
let newObj = copy(self) let newObj = copy(self)
let newObj._quietWarnings = g:syntastic_quiet_warnings let newObj._quietWarnings = g:syntastic_quiet_warnings
let llist = copy(a:rawLoclist) let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
let llist = filter(llist, 'v:val["valid"] == 1')
for e in llist for e in llist
if empty(e['type']) if empty(e['type'])
@ -131,10 +130,9 @@ function! g:SyntasticLoclist.filter(filters)
let rv = [] let rv = []
for error in self._rawLoclist for error in self._rawLoclist
let passes_filters = 1 let passes_filters = 1
for key in keys(a:filters) for key in keys(a:filters)
if error[key] !=? a:filters[key] if get(error, key, '') !=? a:filters[key]
let passes_filters = 0 let passes_filters = 0
break break
endif endif