[TxMt] C bundle: Functions with multi-line argument lists

Pavan Gunupudi pavan at doe.carleton.ca
Mon Jun 11 19:50:00 UTC 2007


On 11-Jun-07, at 3:28 PM, Steve King wrote:

> On Mon, 11 Jun 2007, Allan Odgaard wrote:
>
>> So the problem boils down to, given just the first line of a  
>> construct, can you say what the construct is? In C you sometimes  
>> can’t, in most other languages you generally can.
>
> How about scanning the file backwards from the insertion point to  
> find the start of a multi-line construct whenever the parser finds  
> itself in ambiguous territory?
>
> How does it currently handle things like double-quoted strings or '/ 
> *' comments spanning lines?
>

'/*' comments are quite messy actually.. Try this

/*
if (cond)
{
*/

	blah1;

/*
}
*/

blah2;

Notice the relative indentation between blah1 and blah2. You can even  
fold the if-block!! Actually no surprises here because that's the way  
TextMate's one-line-at-a-time parser works. It just can't find more  
information.

I've got issues with this because, there are several areas in the  
code I work where c-code is commented. That just upsets everything.

For now, thanks to you and James, I am using a combination of astyle  
and gnu-indent to format my code after every block I write to get  
indentation right. But I still can't stop those commented if-blocks  
from folding :)

Pavan

Ps: Well it's a good thing I am realizing the limitations of TextMate  
early in my migration-phase from Emacs. I thought TextMate would be  
the final frontier but I guess not or not yet ;)


> -- 
> Steve King, <steve at narbat.com>
> ______________________________________________________________________
> 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
> -- 
> BEGIN-ANTISPAM-VOTING-LINKS
> ------------------------------------------------------
>
> Teach CanIt if this mail (ID 2351832) is spam:
> Spam:        http://134.117.9.7/canit/b.php? 
> i=2351832&m=7470336a0dc0&c=s
> Not spam:    http://134.117.9.7/canit/b.php? 
> i=2351832&m=7470336a0dc0&c=n
> Forget vote: http://134.117.9.7/canit/b.php? 
> i=2351832&m=7470336a0dc0&c=f
> ------------------------------------------------------
> END-ANTISPAM-VOTING-LINKS




More information about the textmate mailing list