[TxMt] Objective-C completion vs Bracket Matching

Allan Odgaard throw-away-2 at macromates.com
Thu Apr 17 02:20:48 UTC 2008


On 15 Apr 2008, at 20:04, Ciarán Walsh wrote:

> On 15 Apr 2008, at 13:00, Gerd Knops wrote:
>
>> NSFileManager	*fileManager=[NSFileManager defaultManager];
>> if(fileManager fileEx|
>
> Personally I almost always type the closing bracket right after  
> typing the receiver, i.e.
>
>   if(fileManager‸)
> [...]

I think the problem is more apparent in a situation where you already  
have code like:

    if([foo objectForKey:aKey])

And you basically want to add the Objective-C equivalent of: » ==  
@"foo"«

    if([foo objectForKey:aKey] isE‸)

Now you realize you’re not going to type out »isEqualToString:« but  
as this realization comes after having started to type, it is too late  
to use »]« directly after the method call.

Since we do have a db of all framework selectors, I have been thinking  
of maybe let »]« be smart and only leave the caret outside when the  
selector is known, but this would make it less predictable, especially  
since something partially typed might be a valid selector, just not  
the one the user had in mind, so he may not expect the caret to end  
outside.




More information about the textmate mailing list