Skip to content

Conversation

Sawtaytoes
Copy link

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.

colorcoder.py Outdated
Copy link
Owner

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

colorcoder.py Outdated
Copy link
Owner

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))

Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants