From 4cc0b119c0309eccd9a200099d8c9596403c0fa5 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Tue, 19 Nov 2013 09:35:16 +0200 Subject: [PATCH] Minor cleanup. --- autoload/syntastic/log.vim | 56 ++++++++++++++++++------------------ plugin/syntastic/loclist.vim | 6 ++-- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/autoload/syntastic/log.vim b/autoload/syntastic/log.vim index 6fcc1220..aba88197 100644 --- a/autoload/syntastic/log.vim +++ b/autoload/syntastic/log.vim @@ -10,6 +10,33 @@ if !exists("g:syntastic_debug") let g:syntastic_debug = 0 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 = [] " Public functions {{{1 @@ -97,34 +124,7 @@ function! syntastic#log#debugDump(level) return endif - let vars = [ - \ '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) + call syntastic#log#debugShowVariables(a:level, s:global_options) endfunction " Private functions {{{1 diff --git a/plugin/syntastic/loclist.vim b/plugin/syntastic/loclist.vim index 42b67a75..5e425789 100644 --- a/plugin/syntastic/loclist.vim +++ b/plugin/syntastic/loclist.vim @@ -11,8 +11,7 @@ function! g:SyntasticLoclist.New(rawLoclist) let newObj = copy(self) let newObj._quietWarnings = g:syntastic_quiet_warnings - let llist = copy(a:rawLoclist) - let llist = filter(llist, 'v:val["valid"] == 1') + let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1') for e in llist if empty(e['type']) @@ -131,10 +130,9 @@ function! g:SyntasticLoclist.filter(filters) let rv = [] for error in self._rawLoclist - let passes_filters = 1 for key in keys(a:filters) - if error[key] !=? a:filters[key] + if get(error, key, '') !=? a:filters[key] let passes_filters = 0 break endif