예제 #1
0
 def _is_skip(self, context, source):
     if 'syntax_names' in context and source.disabled_syntaxes:
         p = re.compile('(' + '|'.join(source.disabled_syntaxes) + ')$')
         if next(filter(p.search, context['syntax_names']), None):
             return True
     for ft in context['filetypes']:
         input_pattern = source.get_input_pattern(ft)
         if (input_pattern != '' and re.search('(' + input_pattern + ')$',
                                               context['input'])):
             return False
     if context['event'] == 'Manual':
         return False
     return not (source.min_pattern_length <= len(context['complete_str'])
                 <= source.max_pattern_length)
예제 #2
0
 def _is_skip(self, context, source):
     if 'syntax_names' in context and source.disabled_syntaxes:
         p = re.compile('(' + '|'.join(source.disabled_syntaxes) + ')$')
         if next(filter(p.search, context['syntax_names']), None):
             return True
     for ft in context['filetypes']:
         input_pattern = source.get_input_pattern(ft)
         if (input_pattern != '' and
                 re.search('(' + input_pattern + ')$', context['input'])):
             return False
     if context['event'] == 'Manual':
         return False
     return not (source.min_pattern_length <=
                 len(context['complete_str']) <= source.max_pattern_length)