Skip to content

Conversation

@vanrijn
Copy link

@vanrijn vanrijn commented Mar 9, 2013

This change satisfies my need that I requested at #37 and also adds the functionality that was requested at #27

Namely, it adds a new config option called alignment_format to allow for the following possible alignment configurations:

   //   background-color: black;
   //   color:            white;
   // "alignment_format": "key-separator-varspace-value"

   // ... or ...
   //   background-color: black;
   //              color: white;
   // "alignment_format": "varspace-key-separator-value"

   // ... or the default ...
   //   background-color: black;
   //   color           : white;
   "alignment_format": "key-varspace-separator-value"

Thanks!

@vanrijn
Copy link
Author

vanrijn commented Mar 28, 2013

@wbond: I know you're busy with all the package control stuff for ST3, but have you had a chance to look at this yet?

@vanrijn
Copy link
Author

vanrijn commented Apr 12, 2013

I really like the idea from #27 so I modified my code to allow sublime_alignment to do all 3 of the following:

   // This plugin can align the selected lines in a number of ways.
   //   background-color: black;
   //   color:            white;
   // "alignment_format": "key-separator-varspace-value"

   // ... or ...
   //   background-color: black;
   //              color: white;
   // "alignment_format": "varspace-key-separator-value"

   // ... or the default ...
   //   background-color: black;
   //   color           : white;
   "alignment_format": "key-varspace-separator-value"

@GaryJones
Copy link

Looks good - going to be handy :-)

@coderberry
Copy link

Please merge this

@mattiLeBlanc
Copy link

I like the change, but...is it hard to make both situations work?
I use:

h1 span {
    display:          block;
    font-family:      'weblysleek_uisemilight',sans-serif,Arial;
    font-size:        22px;
    font-weight:      400;
    margin-top:       15px;
}

and for JS:

var test              = 23132
,    longvariable     = 343
,    e                = 3434
;

Unfortunately I cannot use both options at the same time. Is it possible that it will do the key/value alignment based on key-separator-varspace-value
and the equals value based on key-varspace-separator-value?

@ericmagnuson
Copy link

Let's get this merged.

@mattiLeBlanc
Copy link

@eric, you mean you can make this work? That would be awesome

@ericmagnuson
Copy link

Well, at the time, I was just showing that there was still interest in this pull.

However, since writing that, I forked this repo and pulled in a number of the currently pending pull requests, including this one. It works fairly well I'd say. You should be able to have two different alignment options by editing Javascript.sublime-settings and CSS.sublime-settings, which can be found in the package's folder.

@mattiLeBlanc
Copy link

I have set the the javascript.sublime-settings as:
{
"alignment_chars": ["=", ":"]
}
But i notice that if I use = or : alignment in a JS file, it doesn't align as the example of mine above.
Maybe i made a configuration error.

But in CSS it is mid aligning the : which I do not want, in JS it is mid-aligning the = which is good, but it is also mid-aligning the : which I would not like

@ericmagnuson
Copy link

Hmm, I couldn't get it to work either. I'll have to see if I can figure out why.

@mattiLeBlanc
Copy link

Glad you had the same result

@kerrizor
Copy link

👍 on getting this into the main project. I hacked together essentially the same solution for my own needs, but would love to see this get in. How can I help?

@James1x0
Copy link

James1x0 commented Sep 4, 2014

👍 Except alignment_format should be for each alignment_char

"alignment_chars": [
  "=": "key-varspace-separator-value",
  ":":  "key-separator-varspace-value"
]

//or

"alignment_chars": [
  {
    "char": "=",
    "format": "key-varspace-separator-value"
  },
  {
    "char": ":",
    "format": "key-separator-varspace-value"
  },
]

@fnky
Copy link

fnky commented Sep 8, 2014

👍 I would love to see this being merged in the near future.

@danillos
Copy link

+1

@ArmorDarks
Copy link

👍 for merge, please!

@DoubleU23
Copy link

please make it real :) ! 👍

btw: how about that?

"alignment_types": {
  "key-varspace-separator-value": ['=', '-', '+', '.'],
  "key-separator-varspace-value": [':']
}

@smartforcedev
Copy link

Any news on this?

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.