Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #66: color scheme is modified twice #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions colorcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def on_load(self,view):
return

if view.size() > set.get('max_size') and not view.settings().get('forcecolorcode',False):
sublime.status_message("File is too big, disabling colorcoding as it might hurt perfromance")
sublime.status_message("File is too big, disabling colorcoding as it might hurt performance")
colorcoder.remove_colorcode(view)
view.settings().set('colorcode',False)
return
Expand Down Expand Up @@ -177,15 +177,15 @@ def panel_callback(self, text):
def maybefixscheme():
set = sublime.load_settings("colorcoder.sublime-settings")
if set.get('auto_apply_on_scheme_change'):
if sublime.load_settings("Preferences.sublime-settings").get('color_scheme').find('/Colorcoder/') == -1:
if sublime.load_settings("Preferences.sublime-settings").get('color_scheme').find('(Colorcoded)') == -1:
colorshemeemodifier.modify_color_scheme(set.get('lightness'),set.get('saturation'))

@staticmethod
def modify_color_scheme(l,s,read_original = False):
read_original = read_original and sublime.load_settings("Preferences.sublime-settings").has("original_color_scheme")
if read_original and sublime.load_settings("Preferences.sublime-settings").get('color_scheme').find('/Colorcoder/') == -1:
if read_original and sublime.load_settings("Preferences.sublime-settings").get('color_scheme').find('(Colorcoded)') == -1:
read_original = False
if read_original and sublime.load_settings("Preferences.sublime-settings").get('original_color_scheme').find('/Colorcoder/') != -1:
if read_original and sublime.load_settings("Preferences.sublime-settings").get('original_color_scheme').find('(Colorcoded)') != -1:
print("original theme already colorcoded, abort")
return
global modification_running
Expand Down