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

Prefix on save #65

Closed
wants to merge 5 commits into from
Closed

Prefix on save #65

wants to merge 5 commits into from

Conversation

dmnsgn
Copy link
Contributor

@dmnsgn dmnsgn commented Dec 15, 2015

Uses on_pre_save event to run autoprefix command on files with .css extension.

Add field in Autoprefixer.sublime-settings:

 {
    "prefixOnSave": false
 }

Fixes #2.

def get_setting(self, key):
settings = self.view.settings().get('Autoprefixer')
@staticmethod
def get_setting(view, key):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to just make this a top-level function instead of a class method.

@sindresorhus
Copy link
Owner

Nice! Thanks for working on this :)

@dmnsgn
Copy link
Contributor Author

dmnsgn commented Dec 17, 2015

Glad to help :) just pushed a fix according to your comments. Is that more what you had in mind for the get_setting top-level function ?

return settings.get(key)

def is_css(view):
return view.settings().get('syntax') == 'Packages/CSS/CSS.tmLanguage'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in latest dev version of Sublime, it's Packages/CSS/CSS.sublime-syntax. So I guess we should only check the file name (not path) without extension.

…ime-syntax format and old .tmLanguage syntax files)
@sindresorhus
Copy link
Owner

So I guess we should only check the file name (not path) without extension.

Only check the filename, not path, just in case the path changes in the future. We really only care about the filename.

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