Do not send request if server is down

Do not send an "event_notification" request in OnFileReadyToParse
function if server process is terminated. Otherwise, it blocks Vim
for one second or results in a traceback each time the InsertLeave,
CursorMoved, CursorHold, and BufferVisit events are triggered.
This commit is contained in:
micbou 2016-03-09 13:39:11 +01:00
parent 381b213271
commit d59dfb0a7e

View File

@ -256,10 +256,11 @@ class YouCompleteMe( object ):
def OnFileReadyToParse( self ): def OnFileReadyToParse( self ):
self._omnicomp.OnFileReadyToParse( None )
if not self.IsServerAlive(): if not self.IsServerAlive():
self._NotifyUserIfServerCrashed() self._NotifyUserIfServerCrashed()
return
self._omnicomp.OnFileReadyToParse( None )
extra_data = {} extra_data = {}
self._AddTagsFilesIfNeeded( extra_data ) self._AddTagsFilesIfNeeded( extra_data )