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

Add a setting to prevent resetting the color scheme. #275

Merged
merged 1 commit into from May 4, 2016
Merged

Add a setting to prevent resetting the color scheme. #275

merged 1 commit into from May 4, 2016

Conversation

hatarist
Copy link
Contributor

@hatarist hatarist commented May 4, 2016

I made it to add compatibility with the InactivePanes package which dims the inactive panes' window's background color.

Haven't seen any quirks of it being enabled so far, but I don't use Color Highlighter.

@vovkkk
Copy link
Collaborator

vovkkk commented May 4, 2016

Would be nice to avoid adding new setting, there are many of them already.

It seems InactivePanes operate on deactivation while Color Highlighter does on activation.
So I think this should work:

    def set_proper_scheme(self, view):
        if view.id() != sublime.active_window().active_view().id():
            return
        pts = sublime.load_settings('PlainTasks.sublime-settings')
        if view.settings().get('color_scheme') == pts.get('color_scheme'):
            return
        # Since we cannot create file with syntax, there is moment when view has no settings,
        # but it is activated, so some plugins (e.g. Color Highlighter) set wrong color scheme
        view.settings().set('color_scheme', pts.get('color_scheme'))

Could you confirm?

@hatarist
Copy link
Contributor Author

hatarist commented May 4, 2016

Yeah, it works, thanks a lot! Sorry for the inconvenience, I should've gotten to know the project better.

Would you like to create a pull request yourself or me to commit it to my branch? (I will surely mention you in the commit message)

@vovkkk
Copy link
Collaborator

vovkkk commented May 4, 2016

Don’t mention me. I’ll merge if you squash.

(Adds compatibility with InactivePanes package)
@vovkkk vovkkk merged commit c96317b into aziz:master May 4, 2016
@hatarist hatarist deleted the disable_color_scheme branch May 4, 2016 17:29
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.

None yet

2 participants