[TxMt] Two issues with TextMates and Objective-C

Greg Miller unixjunkie at mac.com
Tue May 23 18:50:59 UTC 2006


On 5/23/06, Michael Gregoire <mgee at gwi.net> wrote:
> For the first mentioned problem, the indentation after the opening
> brace is affected by the brace's location. I find that placing my
> braces in this form:
>
> - (id)performMethodWithLongName:(id)foo
>                            and:(id)bar
> {
>      // ...
> }

This doesn't really fix the problem, because hitting <ENTER> after
typing "and:(id)bar" will put the opening curly brace in the wrong
spot because of the same indenting issue.

G~


>
> fixes any strange indentation issues. Though, it also forces you to
> change your coding style slightly.
>
> This is definitely something that needs to be rectified with TextMate
> though. Programmers shouldn't have to change their coding style to
> suit the application's quirks.
>
> Peace
> Mike
>
>
>
> On May 23, 2006, at 2:38 PM, Greg Miller wrote:
>
> > I just started using TextMate about a week ago, and so far I love
> > it.  But I
> > write a lot of Objective-C and I see two issues that may get
> > annoying fast.
> > I'd love to hear if anyone is aware of a fix or if I'm just
> > overlooking
> > something.
> >
> > Problems:
> >
> > 1) If I write an method implementation that looks like:
> >
> > - (id)performMethodWithLongName:(id)foo
> >                           and:(id)bar {
> >                             // ...
> > }
> >
> > The autoindent on the first line of the method body is messed up.
> > I have my
> > editor set to use "Soft Tabs: 2", but I don't end up two spaces
> > from the left
> > margin, rather I end up two spaces after the column where the
> > "and:" method
> > parameter started.  It looks like the autoindent spacing is
> > determined by the
> > location of the preceding line, but I'm not sure this will work
> > well with the
> > common spacing patterns used in Objective-C.
> >
> >
> > 2) When I call an Objective-C method, I'd like it to automatically
> > align
> > parameters by the colon.  For example, I'd like it to be smart
> > enough to
> > reformat:
> >
> > foo = [someObject foo:bar baz:quux];
> >
> > into...
> >
> > foo = [obj foo:bar
> >            baz:quux];
> >
> > I figure this one can be done pretty easily w/ a TM command, but
> > I'm more
> > wondering if anyone's already written it.
> >
> > Thanks,
> > Greg
> >
> > ______________________________________________________________________
> > For new threads USE THIS: textmate at lists.macromates.com
> > (threading gets destroyed and the universe will collapse if you don't)
> > http://lists.macromates.com/mailman/listinfo/textmate
> >
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>



More information about the textmate mailing list