-
Notifications
You must be signed in to change notification settings - Fork 23
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
Colorcoder now allows saving to custom directory locations #35
base: master
Are you sure you want to change the base?
Conversation
… to variable directory locations
…ht be able to handle greater than the default value
@@ -64,13 +64,13 @@ def on_load(self,view): | |||
view.settings().set('colorcode',False) | |||
return | |||
|
|||
if view.size() > set.get('max_size',10000) and not view.settings().get('forcecolorcode',False): | |||
if view.size() > set.get('max_size',colorshemeemodifier.get_max_size()) and not view.settings().get('forcecolorcode',False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sublime API states:
get(name, default)
Returns the named setting, or default if it's not defined.
what you are doing here is essentially
set.get('max_size',set.get('max_size'))
which is redundant
please revert this and following changes of same manner
@@ -204,9 +230,9 @@ def modify_color_scheme(l,s,read_original = False): | |||
) | |||
)) | |||
|
|||
newname = "/Colorcoder/%s (Colorcoded).tmTheme" % re.search("/([^/]+).tmTheme$", name).group(1) | |||
newname = "/%s (Colorcoded).tmTheme" % re.search("/([^/]+).tmTheme$", name).group(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way you populate newname
will lead to problems in L#238, as color_scheme
setting expects to have an sublime.load_resource
compatible path eg Packages/Colorcoder/Obsidian (Colorcoded).tmTheme
i guess it would be simpler just to do
newname = "/%s/%s (Colorcoded).tmTheme" % (set.get('colorcoder_schemas_dir').strip("/\\"), re.search("/([^/]+).tmTheme$", name).group(1))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it. It has a relative and full path now. Phew! You were completely right. I was missing something huge!
Modified Colorcoder to allow saving custom (Colorcoded) color schemes to custom directory locations.
I also added a custom max_size so people who have beefier machines can have it automatically turn on for larger files.