randy3k / AlignTab

An alignment plugin for Sublime Text using regular expression
MIT License
631 stars 25 forks source link

Not sure how to align array properly #54

Open isimmons opened 9 years ago

isimmons commented 9 years ago

When trying to align something like

protected $countries = [
      "Western Sahara"                               => "eh",
      "Yemen"                                        => "ye",
      "Serbia"                                       => "yu",
      "Zambia"                                       => "zm",
      "Zimbabwe"                                     => "zw"
];

I"m trying to get it to line up based on the "=>" with both right and left columns left justified and right justified and the "=>" lining up like this

protected $countries = [
      "Western Sahara"    =>    "eh",
      "Yemen"                   =>     "ye",
      "Serbia"                    =>     "yu",
      "Zambia"                  =>     "zm",
      "Zimbabwe"             =>     "zw"
];

But it seems I can only justify either left or right column and not line up the "=>"

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24920738-not-sure-how-to-align-array-properly?utm_campaign=plugin&utm_content=tracker%2F334171&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F334171&utm_medium=issues&utm_source=github).
isimmons commented 9 years ago

Well I can't even get it to align when I paste it into github.

This is what I'm trying to achieve.

countryarray

tylermumford commented 9 years ago

Based on your screenshot, it looks like you're using a non-monospace font in Sublime. For all intents and purposes, your code will never look perfectly aligned unless you view it with a monospace font, such as Source Code Pro (Sublime's default, I believe).