randy3k / AlignTab

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

Aligning nested Arrays #57

Closed stoivo closed 2 years ago

stoivo commented 8 years ago

Hey,

I have an idea that I think would be cool, I am not really sure if this can be solved or not? but if you can give it a shoot and tell me what you think.

# What I want to align
{
  "A" => "a",
  "B" => "b",
  "C" => "c",
  "D" => "d",
  "EFG" => {
    "E" => "e",
    "F" => "F",
    "G" => "G",
    "????????" => "¯\_(ツ)_/¯",
  }
}

# What is does
{
  "A"        => "a",
  "B"        => "b",
  "C"        => "c",
  "D"        => "d",
  "EFG"      => {
  "E"        => "e",
  "F"        => "F",
  "G"        => "G",
  "????????" => "¯\_(ツ)_/¯",
  }
}

# What I would like to
{
  "A"   => "a",
  "B"   => "b",
  "C"   => "c",
  "D"   => "d",
  "EFG" => {
    "E"        => "e",
    "F"        => "F",
    "G"        => "G",
    "????????" => "¯\_(ツ)_/¯",
  }
}

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/29599189-aligning-nested-arrays?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).
randy3k commented 8 years ago

I don't think it can be done in current implementation. However, it is something which is worth some thinkings.

stoivo commented 8 years ago

Cool :sparkles:

randy3k commented 8 years ago

Ai, I forgot to mention that you could always highlight and align the selected regions. It may be usable for simple situations.

stoivo commented 8 years ago

Yes, thanks.