sublime_alignment icon indicating copy to clipboard operation
sublime_alignment copied to clipboard

Option to not add whitespace before alignment_chars

Open vanrijn opened this issue 13 years ago • 5 comments

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 avatar Feb 05 '13 23:02 vanrijn

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 avatar Feb 06 '13 02:02 vanrijn

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!

vanrijn avatar Feb 06 '13 02:02 vanrijn

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

zchrykng avatar Feb 09 '13 21:02 zchrykng

Awesome, thanks for the help Zachary!

vanrijn avatar Mar 09 '13 23:03 vanrijn

No problem!

zchrykng avatar Mar 10 '13 00:03 zchrykng