:YcmDiags exits when compilation fails

Previously we'd tell the user "No warnings or errors detected", which is wrong.
This commit is contained in:
Strahinja Val Markovic 2013-03-17 18:52:42 -07:00
parent 56b2f70a1a
commit 0535d0ec9a

View File

@ -581,7 +581,11 @@ command! YcmForceCompileAndDiagnostics call s:ForceCompileAndDiagnostics()
function! s:ShowDiagnostics() function! s:ShowDiagnostics()
call s:ForceCompile() let compilation_succeeded = s:ForceCompile()
if !compilation_succeeded
return
endif
let diags = pyeval( 'ycm_state.GetDiagnosticsForCurrentFile()' ) let diags = pyeval( 'ycm_state.GetDiagnosticsForCurrentFile()' )
if !empty( diags ) if !empty( diags )
call setloclist( 0, diags ) call setloclist( 0, diags )