From 4e32123b535370d97a168c5f02fb0ea4376b6182 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Thu, 11 Apr 2013 23:49:39 +0300 Subject: [PATCH] Make the enabled() method optional. --- plugin/syntastic/autoloclist.vim | 4 ---- plugin/syntastic/cursor.vim | 4 ---- plugin/syntastic/notifiers.vim | 3 ++- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/plugin/syntastic/autoloclist.vim b/plugin/syntastic/autoloclist.vim index 508a08f0..9a1a018f 100644 --- a/plugin/syntastic/autoloclist.vim +++ b/plugin/syntastic/autoloclist.vim @@ -16,10 +16,6 @@ function! g:SyntasticAutoloclistNotifier.New() return newObj endfunction -function! g:SyntasticAutoloclistNotifier.enabled() - return 1 -endfunction - function! g:SyntasticAutoloclistNotifier.refresh(loclist) call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist) endfunction diff --git a/plugin/syntastic/cursor.vim b/plugin/syntastic/cursor.vim index 830e57ee..e924e72e 100644 --- a/plugin/syntastic/cursor.vim +++ b/plugin/syntastic/cursor.vim @@ -17,10 +17,6 @@ function! g:SyntasticCursorNotifier.New() return newObj endfunction -function! g:SyntasticCursorNotifier.enabled() - return 1 -endfunction - function! g:SyntasticCursorNotifier.refresh(loclist) autocmd! syntastic CursorMoved let enabled = exists('b:syntastic_echo_current_error') ? b:syntastic_echo_current_error : g:syntastic_echo_current_error diff --git a/plugin/syntastic/notifiers.vim b/plugin/syntastic/notifiers.vim index 7bb396e3..d7873a3e 100644 --- a/plugin/syntastic/notifiers.vim +++ b/plugin/syntastic/notifiers.vim @@ -25,7 +25,8 @@ endfunction function! g:SyntasticNotifiers.refresh(loclist) for type in self._enabled_types - if self._notifier[type].enabled() + let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') + if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled() call self._notifier[type].refresh(a:loclist) endif endfor