def get_tag_mode(view, tag_mode_config):
 default_mode = None
 syntax = view.settings().get('syntax')
 language = (splitext(basename(syntax))[0].lower() if (syntax is not None) else 'plain text')
 if isinstance(tag_mode_config, list):
  for item in tag_mode_config:
   if (isinstance(item, dict) and compare_languge(language, item.get('syntax', []))):
    first_line = item.get('first_line', '')
    if first_line:
     size = (view.size() - 1)
     if (size > 256):
      size = 256
     if (isinstance(first_line, str) and bre.compile_search(first_line, bre.I).match(view.substr(sublime.Region(0, size)))):
      return item.get('mode', default_mode)
    else:
     return item.get('mode', default_mode)
 return default_mode

def get_tag_mode ( view , tag_mode_config ) : default_mode = None syntax = view . settings ( ) . get ( 'syntax' ) language = ( splitext ( basename ( syntax ) ) [ 0 ] . lower ( ) if ( syntax is not None ) else 'plain text' ) if isinstance ( tag_mode_config , list ) : for item in tag_mode_config : if ( isinstance ( item , dict ) and compare_languge ( language , item . get ( 'syntax' , [ ] ) ) ) : first_line = item . get ( 'first_line' , '' ) if first_line : size = ( view . size ( ) - 1 ) if ( size > 256 ) : size = 256 if ( isinstance ( first_line , str ) and bre . compile_search ( first_line , bre . I ) . match ( view . substr ( sublime . Region ( 0 , size ) ) ) ) : return item . get ( 'mode' , default_mode ) else : return item . get ( 'mode' , default_mode ) return default_mode
get the tag mode .