Use OnBufferVisit in ultisnips completer

This is instead of OnFileReadyToParse which is called every time the users stops
typing.
This commit is contained in:
Strahinja Val Markovic 2013-04-24 13:31:28 -07:00
parent 8c0a9bc90e
commit 7500a94cda
3 changed files with 9 additions and 1 deletions

View File

@ -205,6 +205,7 @@ function! s:OnBufferVisit()
call s:SetUpCompleteopt()
call s:SetCompleteFunc()
py ycm_state.OnBufferVisit()
call s:OnFileReadyToParse()
endfunction

View File

@ -50,7 +50,7 @@ class UltiSnipsCompleter( GeneralCompleter ):
return self._filtered_candidates if self._filtered_candidates else []
def OnFileReadyToParse( self ):
def OnBufferVisit( self ):
self._candidates = _GetCandidates()

View File

@ -145,6 +145,13 @@ class YouCompleteMe( object ):
self.GetFiletypeCompleter().OnBufferDelete( deleted_buffer_file )
def OnBufferVisit( self ):
self.gencomp.OnBufferVisit()
if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnBufferVisit()
def OnInsertLeave( self ):
self.gencomp.OnInsertLeave()