From 2bad8761fa57aafee2099bcfb2fdb1190e27f468 Mon Sep 17 00:00:00 2001 From: David Stanek Date: Fri, 10 Aug 2012 03:23:46 -0400 Subject: [PATCH] Fixes #311: errors not showing up in statusline s:Errors() function loops through the location list lookin for errors and caches the result. The function is called indirectly by SynasticStatuslineFlag before the location list has content. This patch ensures s:Errors only gets called if location list has content. --- plugin/syntastic.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 06766746..6e8bf3fc 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -243,7 +243,10 @@ function! s:ModeMapAllowsAutoChecking() endfunction function! s:BufHasErrorsOrWarningsToDisplay() - return len(s:Errors()) || (!g:syntastic_quiet_warnings && !empty(s:LocList())) + if empty(s:LocList()) + return 0 + endif + return len(s:Errors()) || !g:syntastic_quiet_warnings endfunction function! s:Errors()