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

Alpha sort option for CSS/LESS #96

Closed
sebastiankade opened this issue Sep 15, 2014 · 9 comments
Closed

Alpha sort option for CSS/LESS #96

sebastiankade opened this issue Sep 15, 2014 · 9 comments

Comments

@sebastiankade
Copy link

Wanted the ability to turn off alpha sorting in LESS files.

Raised with Pretty-Diff here: prettydiff/prettydiff#28 (comment)

Added to pretty-diff in commit: prettydiff/prettydiff@af5fea0

Can the updated version of pretty-diff be added to atom-beautify?

Cheers

@Glavin001
Copy link
Owner

Thanks for bringing this to my attention!

  • Update Pretty-Diff dependency to ^1.2.4

@Glavin001
Copy link
Owner

Published to v0.11.1

@sebastiankade
Copy link
Author

Upgraded to v.0.11.1 but didn't notice any change. Also tried adding

"alphasort": false

to .jsbeautifyrc in project root but hasn't had an effect.

@Glavin001
Copy link
Owner

Does reloading / restarting Atom resolve this? I've had many problems persist between updates because Atom appears to not truly update the code running in memory.

@sebastiankade
Copy link
Author

Nope tried restarting and fiddling but still sorts my css properties by alpha

@Glavin001 Glavin001 reopened this Sep 27, 2014
@Glavin001
Copy link
Owner

I am up-to-date with PrettyDiff and am still seeing alphasort with Atom Beautify. I also am unable to get the Command Line Interface of PrettyDiff to work to test... I got the CLI working for PrettyDiff:

$ node node-local.js source:"/Users/glavin/Documents/Project Dev/atom-beautify/examples/simple-jsbeautifyrc/alphasort1.scss" mode:"beautify" readmethod:"file" output:"/Users/glavin/Documents/Project Dev/atom-beautify/examples/simple-jsbeautifyrc/alphasort1_out.scss"

Before

.example(){
   .base-apple(); // Sets base apple color to red
   .apple-color(@color-green); // Sets apple color to green
}

After

undefined.example() {
    .base-apple();
    // Sets base apple color to red
    .apple-color(@color-green);
    // Sets apple color to green
}

Which looks to be partially working, with exception of the undefined at the beginning.

@Glavin001
Copy link
Owner

So looks like the problem is 1) Atom Beautify does not forward the alphasort option in it's args to PrettyDiff and 2) PrettyDiff is not defaulting to false for alphasort.

I have patched this from the Atom Beautify side by allowing alphasort to be forwarded to PrettyDiff.

Before

.example(){
   .base-apple(); // Sets base apple color to red
   .apple-color(@color-green); // Sets apple color to green
}

After

.example() {
  .base-apple();
  // Sets base apple color to red
  .apple-color(@color-green);
  // Sets apple color to green
}

@Glavin001
Copy link
Owner

Published to v0.13.2

@sebastiankade
Copy link
Author

Updated and working :)

Thanks for the quick turn around

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

No branches or pull requests

2 participants