Skip to content

Commit

Permalink
Fixed issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Vittorio Vittori committed Oct 2, 2014
1 parent f412749 commit 3c0ddb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ThemeAutomator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sublime_settings = sublime.load_settings('Preferences.sublime-settings')
plugin_settings = sublime.load_settings('ThemeAutomator.sublime-settings')
schemes = plugin_settings.get('schemes')

automate_selection = plugin_settings.get('automate_selection')
if automate_selection is None:
automate_selection = True
Expand Down Expand Up @@ -57,8 +58,10 @@ def on_activated(self, view):
root,ext = os.path.splitext(view.file_name())
if ext in extensions():
color_scheme = theme(ext)
if sublime_settings.get('color_scheme') != color_scheme:
if sublime_settings.get('color_scheme') != color_scheme and schemes is not None:
save_scheme(color_scheme)
else:
add_scheme(ext, sublime_settings.get('color_scheme'))
else:
if automate_selection == True:
add_scheme(ext, sublime_settings.get('color_scheme'))
Expand Down

0 comments on commit 3c0ddb1

Please sign in to comment.