From fbbb30295b93380a68cfb430adad09720e03cfbd Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sat, 13 Apr 2013 16:51:23 +0100 Subject: [PATCH] add a simple debug message system We may want to add debug messages at many points. We can add them as we find we need them - i.e. when debugging stuff with users. --- autoload/syntastic/util.vim | 10 ++++++++++ plugin/syntastic.vim | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/autoload/syntastic/util.vim b/autoload/syntastic/util.vim index 84378991..c6d7c05f 100644 --- a/autoload/syntastic/util.vim +++ b/autoload/syntastic/util.vim @@ -92,6 +92,16 @@ function! syntastic#util#wideMsg(msg) let &showcmd=old_showcmd endfunction +if !exists("g:syntastic_debug") + let g:syntastic_debug = 0 +endif + +function! syntastic#util#debug(msg) + if g:syntastic_debug + echomsg "(Syntastic debug) - " . a:msg + endif +endfunction + let &cpo = s:save_cpo unlet s:save_cpo " vim: set et sts=4 sw=4: diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index d6059566..d3c9a4fc 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -132,6 +132,8 @@ function! s:CacheErrors(...) endif for checker in checkers + call syntastic#util#debug("CacheErrors: Invoking checker: " . checker.name()) + let loclist = checker.getLocList() if !loclist.isEmpty() @@ -257,6 +259,8 @@ endfunction " 'defaults' - a dict containing default values for the returned errors " 'subtype' - all errors will be assigned the given subtype function! SyntasticMake(options) + call syntastic#util#debug('SyntasticMake: called with options: '. string(a:options)) + let old_loclist = getloclist(0) let old_makeprg = &l:makeprg let old_shellpipe = &shellpipe