Allow TM_SOURCE_ALIGNMENT_PATTERN to specify before/after for each match #1

Closed
emmanuel opened this Issue Aug 28, 2012 · 1 comment

2 participants

@emmanuel

Perhaps I'm approaching this from the wrong angle, but it appears that TM_SOURCE_ALIGNMENT_PATTERN only permits a single 'place whitespace before/after' value. However, in Ruby, I want to place whitespace before some separators, and after others. Viz:

# standard Hash-literal syntax:
{
  :short => 'bar',
  :much_longer => 'baz'
}

# should become:
{
  :short       => 'bar',
  :much_longer => 'baz'
}

# but 1.9 Hash-literal syntax:
{
  short: 'bar',
  much_longer: 'baz'
}

# should become:
{
  short:       'bar',
  much_longer: 'baz'
}

Is this currently possible with the align bundle?

@mads-hartmann

Hi there. Please read the README I just updated, it has some more details :)

I added some default settings for Ruby just to show how to do it. Please update the bundle and give it a try.

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