Make the enabled() method optional.

This commit is contained in:
LCD 47 2013-04-11 23:49:39 +03:00
parent 0248a848d3
commit 4e32123b53
3 changed files with 2 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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