Adding OnVimLeave support to Completer class

This commit is contained in:
Strahinja Val Markovic 2013-07-07 10:59:48 -07:00
parent 7a13fd8af6
commit 451acc0073
4 changed files with 17 additions and 0 deletions

View File

@ -207,6 +207,7 @@ function! s:SetUpCompleteopt()
endfunction endfunction
function! s:OnVimLeave() function! s:OnVimLeave()
py ycm_state.OnVimLeave()
py extra_conf_store.CallExtraConfVimCloseIfExists() py extra_conf_store.CallExtraConfVimCloseIfExists()
endfunction endfunction

View File

@ -278,6 +278,10 @@ class Completer( object ):
pass pass
def OnVimLeave( self ):
pass
def OnUserCommand( self, arguments ): def OnUserCommand( self, arguments ):
vimsupport.PostVimMessage( NO_USER_COMMANDS ) vimsupport.PostVimMessage( NO_USER_COMMANDS )

View File

@ -130,6 +130,11 @@ class GeneralCompleterStore( Completer ):
completer.OnInsertLeave() completer.OnInsertLeave()
def OnVimLeave( self ):
for completer in self._all_completers:
completer.OnVimLeave()
def OnCurrentIdentifierFinished( self ): def OnCurrentIdentifierFinished( self ):
for completer in self._all_completers: for completer in self._all_completers:
completer.OnCurrentIdentifierFinished() completer.OnCurrentIdentifierFinished()

View File

@ -144,6 +144,13 @@ class YouCompleteMe( object ):
self.GetFiletypeCompleter().OnInsertLeave() self.GetFiletypeCompleter().OnInsertLeave()
def OnVimLeave( self ):
self.gencomp.OnVimLeave()
if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnVimLeave()
def DiagnosticsForCurrentFileReady( self ): def DiagnosticsForCurrentFileReady( self ):
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
return self.GetFiletypeCompleter().DiagnosticsForCurrentFileReady() return self.GetFiletypeCompleter().DiagnosticsForCurrentFileReady()