From 0535d0ec9ac1b165472479fec3648bb7c3cfe413 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sun, 17 Mar 2013 18:52:42 -0700 Subject: [PATCH] :YcmDiags exits when compilation fails Previously we'd tell the user "No warnings or errors detected", which is wrong. --- autoload/youcompleteme.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index eb349a0a..c2a8178c 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -581,7 +581,11 @@ command! YcmForceCompileAndDiagnostics call s:ForceCompileAndDiagnostics() function! s:ShowDiagnostics() - call s:ForceCompile() + let compilation_succeeded = s:ForceCompile() + if !compilation_succeeded + return + endif + let diags = pyeval( 'ycm_state.GetDiagnosticsForCurrentFile()' ) if !empty( diags ) call setloclist( 0, diags )