From 3e5e34b633cc3fec9497d025ca5b13ec2c4f2f6f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 9 Dec 2013 11:32:01 +0100 Subject: [PATCH] Only notify about a server crash once Fixes #715 --- python/ycm/youcompleteme.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index c84b350a..9c823e81 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -64,6 +64,7 @@ SERVER_IDLE_SUICIDE_SECONDS = 10800 # 3 hours class YouCompleteMe( object ): def __init__( self, user_options ): self._user_options = user_options + self._user_notified_about_crash = False self._omnicomp = OmniCompleter( user_options ) self._latest_completion_request = None self._latest_file_parse_request = None @@ -121,8 +122,9 @@ class YouCompleteMe( object ): def _NotifyUserIfServerCrashed( self ): - if self._IsServerAlive(): + if self._user_notified_about_crash or self._IsServerAlive(): return + self._user_notified_about_crash = True if self._server_stderr: with open( self._server_stderr, 'r' ) as server_stderr_file: error_output = ''.join( server_stderr_file.readlines()[ @@ -141,6 +143,7 @@ class YouCompleteMe( object ): def RestartServer( self ): vimsupport.PostVimMessage( 'Restarting ycmd server...' ) + self._user_notified_about_crash = False self.OnVimLeave() self._SetupServer()