Minor code style fixes

This commit is contained in:
Strahinja Val Markovic 2013-09-01 20:19:46 -07:00
parent 22256f361d
commit cb74119353

View File

@ -32,17 +32,17 @@ FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE = vim.eval(
class YouCompleteMe( object ): class YouCompleteMe( object ):
def __init__( self ): def __init__( self ):
self.gencomp = GeneralCompleterStore() self._gencomp = GeneralCompleterStore()
self.omnicomp = OmniCompleter() self._omnicomp = OmniCompleter()
self.filetype_completers = {} self._filetype_completers = {}
def GetGeneralCompleter( self ): def GetGeneralCompleter( self ):
return self.gencomp return self._gencomp
def GetOmniCompleter( self ): def GetOmniCompleter( self ):
return self.omnicomp return self._omnicomp
def GetFiletypeCompleter( self ): def GetFiletypeCompleter( self ):
@ -56,7 +56,7 @@ class YouCompleteMe( object ):
# Try to find a native completer first # Try to find a native completer first
for completer in completers: for completer in completers:
if completer and completer is not self.omnicomp: if completer and completer is not self._omnicomp:
return completer return completer
# Return the omni completer for the first filetype # Return the omni completer for the first filetype
@ -65,7 +65,7 @@ class YouCompleteMe( object ):
def GetFiletypeCompleterForFiletype( self, filetype ): def GetFiletypeCompleterForFiletype( self, filetype ):
try: try:
return self.filetype_completers[ filetype ] return self._filetype_completers[ filetype ]
except KeyError: except KeyError:
pass pass
@ -79,15 +79,15 @@ class YouCompleteMe( object ):
if completer: if completer:
supported_filetypes.extend( completer.SupportedFiletypes() ) supported_filetypes.extend( completer.SupportedFiletypes() )
else: else:
completer = self.omnicomp completer = self._omnicomp
for supported_filetype in supported_filetypes: for supported_filetype in supported_filetypes:
self.filetype_completers[ supported_filetype ] = completer self._filetype_completers[ supported_filetype ] = completer
return completer return completer
def ShouldUseGeneralCompleter( self, start_column ): def ShouldUseGeneralCompleter( self, start_column ):
return self.gencomp.ShouldUseNow( start_column, vim.current.line ) return self._gencomp.ShouldUseNow( start_column, vim.current.line )
def ShouldUseFiletypeCompleter( self, start_column ): def ShouldUseFiletypeCompleter( self, start_column ):
@ -99,7 +99,7 @@ class YouCompleteMe( object ):
def NativeFiletypeCompletionAvailable( self ): def NativeFiletypeCompletionAvailable( self ):
completer = self.GetFiletypeCompleter() completer = self.GetFiletypeCompleter()
return bool( completer ) and completer is not self.omnicomp return bool( completer ) and completer is not self._omnicomp
def FiletypeCompletionAvailable( self ): def FiletypeCompletionAvailable( self ):
@ -117,35 +117,35 @@ class YouCompleteMe( object ):
def OnFileReadyToParse( self ): def OnFileReadyToParse( self ):
self.gencomp.OnFileReadyToParse() self._gencomp.OnFileReadyToParse()
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnFileReadyToParse() self.GetFiletypeCompleter().OnFileReadyToParse()
def OnBufferUnload( self, deleted_buffer_file ): def OnBufferUnload( self, deleted_buffer_file ):
self.gencomp.OnBufferUnload( deleted_buffer_file ) self._gencomp.OnBufferUnload( deleted_buffer_file )
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnBufferUnload( deleted_buffer_file ) self.GetFiletypeCompleter().OnBufferUnload( deleted_buffer_file )
def OnBufferVisit( self ): def OnBufferVisit( self ):
self.gencomp.OnBufferVisit() self._gencomp.OnBufferVisit()
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnBufferVisit() self.GetFiletypeCompleter().OnBufferVisit()
def OnInsertLeave( self ): def OnInsertLeave( self ):
self.gencomp.OnInsertLeave() self._gencomp.OnInsertLeave()
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnInsertLeave() self.GetFiletypeCompleter().OnInsertLeave()
def OnVimLeave( self ): def OnVimLeave( self ):
self.gencomp.OnVimLeave() self._gencomp.OnVimLeave()
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnVimLeave() self.GetFiletypeCompleter().OnVimLeave()
@ -175,15 +175,15 @@ class YouCompleteMe( object ):
def OnCurrentIdentifierFinished( self ): def OnCurrentIdentifierFinished( self ):
self.gencomp.OnCurrentIdentifierFinished() self._gencomp.OnCurrentIdentifierFinished()
if self.FiletypeCompletionUsable(): if self.FiletypeCompletionUsable():
self.GetFiletypeCompleter().OnCurrentIdentifierFinished() self.GetFiletypeCompleter().OnCurrentIdentifierFinished()
def DebugInfo( self ): def DebugInfo( self ):
completers = set( self.filetype_completers.values() ) completers = set( self._filetype_completers.values() )
completers.add( self.gencomp ) completers.add( self._gencomp )
output = [] output = []
for completer in completers: for completer in completers:
if not completer: if not completer: