wbond / sublime_alignment

Easy alignment of multiple selections and multi-line selections
http://wbond.net/sublime_packages/alignment
522 stars 110 forks source link

Option to not add whitespace before alignment_chars #37

Open vanrijn opened 11 years ago

vanrijn commented 11 years ago

Hi there! I'm working on some Objective-C code like this:

  [[NSNotificationCenter defaultCenter]
   addObserver:self
   selector:@selector(onNotification:)
   name:NSWindowDidResignKeyNotification
   object:nil];

I would like to use your alignment plugin to reformat this to look like this:

 [[NSNotificationCenter defaultCenter]
     addObserver:self
        selector:@selector(onNotification:)
            name:NSWindowDidResignKeyNotification
          object:nil];

(lines 2 - 5 are aligned at the first colon). But when I use the alignment plugin to try to do this, I end up with this:

  [[NSNotificationCenter defaultCenter]
  addObserver:self
   selector  :@selector(onNotification:)
   name      :NSWindowDidResignKeyNotification
   object    :nil];

In other words, the lines are aligned on the colons correctly, but I don't want the whitespace added between "selector" and the colon, at line 3, for example.

Is it possible to do this? Thank you!

vanrijn commented 11 years ago

I spent a little bit of time tonight hacking what I'm looking for into your plugin. I'm not sure what the best way is to communicate this with you, so I created a gist from it. My apologies... I haven't really worked with github or gist before so I am probably not doing this right. Here's my patch: https://gist.github.com/vanrijn/4719604

What do you think?

vanrijn commented 11 years ago

Also, if there's a better way to share this with you or something that would make it easier to integrate or review this, please just let me know how to do that and I'll gladly do it. =:) Thanks again!

zchrykng commented 11 years ago

You could fork the repo, patch it, and then issue a pull request.

vanrijn commented 11 years ago

Awesome, thanks for the help Zachary!

zchrykng commented 11 years ago

No problem!