parameters: (view)
return_statement: return lang
docstring: Guess current language from view.
docstring_summary: Guess current language from view.
docstring_tokens: Guess current language from view .
function: def get_language_from_view(view):
      """Guess current language from view."""
  
      lang = None
      user_map = sublime.load_settings('Preferences.sublime-settings').get('mdpopups.sublime_user_lang_map', {})
      syntax = os.path.splitext(view.settings().get('syntax').replace('Packages/', '', 1))[0]
      keys = set(list(lang_map.keys()) + list(user_map.keys()))
      for key in keys:
          v1 = lang_map.get(key, (tuple(), tuple()))[1]
          v2 = user_map.get(key, (tuple(), tuple()))[1]
          if syntax in (tuple(v2) + v1):
              lang = key
              break
      return lang
function_tokens: def get_language_from_view ( view ) : lang = None user_map = sublime . load_settings ( 'Preferences.sublime-settings' ) . get ( 'mdpopups.sublime_user_lang_map' , { } ) syntax = os . path . splitext ( view . settings ( ) . get ( 'syntax' ) . replace ( 'Packages/' , '' , 1 ) ) [ 0 ] keys = set ( list ( lang_map . keys ( ) ) + list ( user_map . keys ( ) ) ) for key in keys : v1 = lang_map . get ( key , ( tuple ( ) , tuple ( ) ) ) [ 1 ] v2 = user_map . get ( key , ( tuple ( ) , tuple ( ) ) ) [ 1 ] if syntax in ( tuple ( v2 ) + v1 ) : lang = key break return lang