adrianlee44 / atom-aligner

Easily align multi-line with support for different operators and custom configurations
https://atom.io/packages/aligner
MIT License
78 stars 3 forks source link

Allow :whitespace: as separator #47

Closed m4dz closed 8 years ago

m4dz commented 8 years ago

Hi!

I'm used to work with Stylus files, and it allows to forgot : when declaring properties (http://stylus-lang.com/docs/selectors.html), so:

body
    background-color #333
    color white

will be compiled to:

body {
    background-color: #333;
    color: white;
}

I want / need to align my CSS properties in this form:

body
    background-color #333
    color            white

Can we use a dedicated separator like first whitespace available to make alignment? Is this possible only with a provider, or do we need to hack the aligner core to do this? I can develop it, but I need some first tips to start :wink:.

Thanks!

adrianlee44 commented 8 years ago

Hi @m4dz, I used to work with Stylus too and remember those whitespaces. Whitespaces is a little tricky. Let me double check the stylus grammar. Most like a new provider and some core code changes will be needed.

m4dz commented 8 years ago

Oops, I missed your reply, so sorry :sweat: Tell me if I can help you in any way. Thanks a lot for your work!

adrianlee44 commented 8 years ago

I have finally gotten around to look deeper into this issue. With the release of v0.21.0, aligner now support whitespace as separator.

You will have to install https://atom.io/packages/aligner-stylus to align whitespace correctly though.

Since Aligner relies on the grammar to work properly, I have tested this against https://atom.io/packages/stylus. Let me know if you are using other packages and it's not working with those.

m4dz commented 8 years ago

Woohooo, you're awesome :tada:! Thanks :+1: !