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 )