Skip to content

Commit

Permalink
Fixed syntax highlighting in SublimeText 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
shapov committed Jan 16, 2014
1 parent 0275df3 commit d6e71ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gist.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,12 @@ def open_gist(gist_url):
else:
new_syntax = os.path.join(language, "{0}.tmLanguage".format(language))

new_syntax_path = os.path.join(sublime.packages_path(), new_syntax)

if os.path.exists(new_syntax_path):
# Version check to support both ST2 and ST3 syntax file loading
if int(sublime.version()) > 3000:
new_syntax_path = os.path.join('Packages', language, "{0}.tmLanguage".format(language))
view.set_syntax_file(new_syntax)
elif os.path.exists(new_syntax_path):
new_syntax_path = os.path.join(sublime.packages_path(), new_syntax)
view.set_syntax_file(new_syntax_path)


Expand Down

0 comments on commit d6e71ef

Please sign in to comment.