Permalink
Browse files

Autoset file syntax

  • Loading branch information...
1 parent 55ef181 commit b4e6743b9dc08899811ae3305a3d971a7de536be @lexich lexich committed Jul 15, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 gist.py
View
@@ -202,6 +202,12 @@ def open_gist(gist_url):
edit = view.begin_edit()
view.insert(edit, 0, gist['files'][gist_filename]['content'])
view.end_edit(edit)
+ language = gist['files'][gist_filename]['language']
+ new_syntax = os.path.join(language,"{0}.tmLanguage".format(language))
+ new_syntax_path = os.path.join(sublime.packages_path(), new_syntax)
+ print new_syntax_path
+ if os.path.exists(new_syntax_path):
+ view.set_syntax_file( new_syntax_path )
def get_gists():
return api_request(GISTS_URL)

0 comments on commit b4e6743

Please sign in to comment.