AlignTab icon indicating copy to clipboard operation
AlignTab copied to clipboard

Not sure how to align array properly

Open isimmons opened this issue 8 years ago • 2 comments

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! We accept bounties via Bountysource.

isimmons avatar Jul 25 '15 03:07 isimmons

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

This is what I'm trying to achieve.

countryarray

isimmons avatar Jul 25 '15 04:07 isimmons

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).

tylermumford avatar Aug 04 '15 00:08 tylermumford