def FiletypeCompletionEnabledForCurrentFile( self ): filetypes = vimsupport.CurrentFiletypes() filetype_disabled = all([ x in FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE for x in filetypes ]) return ( not filetype_disabled and self.FiletypeCompletionAvailableForFile() )
def _CurrentFiletype(self): filetypes = vimsupport.CurrentFiletypes() supported = self.SupportedFiletypes() for filetype in filetypes: if filetype in supported: return filetype return filetypes[0]
def GetFiletypeCompleterForCurrentFile( self ): filetypes = vimsupport.CurrentFiletypes() for filetype in filetypes: completer = self.GetFiletypeCompleterForFiletype( filetype ) if completer: return completer return None
def GetFiletypeCompleter(self): filetypes = vimsupport.CurrentFiletypes() completers = [ self.GetFiletypeCompleterForFiletype(filetype) for filetype in filetypes ] if not completers: return None # Try to find a native completer first for completer in completers: if completer and completer is not self.omnicomp: return completer # Return the omni completer for the first filetype return completers[0]
def _CurrentFiletypeCompletionEnabled(): filetypes = vimsupport.CurrentFiletypes() return not all( [x in FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE for x in filetypes])
def InCFamilyFile(): return any( [ filetype in CLANG_FILETYPES for filetype in vimsupport.CurrentFiletypes() ] )