[TxMt] Folding comments in PHP

Richard Dyce dd at dyce.com
Wed May 23 09:15:37 UTC 2007


Ah ha! (One forehead slap later!) Thanks Michael!

FWIW the following alterations to the HTML language seems to do the  
trick, with (as yet) no perceived fallout....

	foldingStartMarker = '(?x)
		(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset| 
style|script|ul|ol|form|dl)\b.*?>
		|<!--(?!.*--\s*>)
		|^<!--\ \#tminclude\ (?>.*?-->)$
		|\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
		|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
		|^\s*/\*\*$ # added for folding docblocks
		)';
	foldingStopMarker = '(?x)
		(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset| 
style|script|ul|ol|form|dl)>
		|^(?!.*?<!--).*?--\s*>
		|^<!--\ end\ tminclude\ -->$
		|\{\{?/(if|foreach|capture|literal|foreach|php|section|strip)
		|^[^{]*\}
		|^\s*\*/$ # added for folding docblocks
		)';


Thanks.

R
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2405 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070523/9d6d2ff8/attachment.p7s>


More information about the textmate mailing list