From d59dfb0a7e510d2d318263661bd3009c7d1f9551 Mon Sep 17 00:00:00 2001 From: micbou Date: Wed, 9 Mar 2016 13:39:11 +0100 Subject: [PATCH] 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. --- python/ycm/youcompleteme.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 21ce5240..5cb91585 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -256,10 +256,11 @@ class YouCompleteMe( object ): def OnFileReadyToParse( self ): - self._omnicomp.OnFileReadyToParse( None ) - if not self.IsServerAlive(): self._NotifyUserIfServerCrashed() + return + + self._omnicomp.OnFileReadyToParse( None ) extra_data = {} self._AddTagsFilesIfNeeded( extra_data )