[TxMt] help with workaround with known bug

Oliver Taylor ollieman at gmail.com
Fri May 5 01:44:43 UTC 2006


> Set the output to "Insert as snippet" and wrap it in ${0:...}? you'll
> need to escape the ... bit of course.

Do you mean this:

#!/usr/bin/perl -w
$m1=$m2='';
$c=1;
while(<>)
{
	if(/^\t{4}(.+)[\r\n]+$/)
	{
		$m1=$m2;
		$m2=$1;
	}
	$c++;
	last if($c==$ENV{'TM_LINE_NUMBER'});
}
print "\n\n\t\t\t\t\${0:\$m1}";

...'cause that seems to work but inserts two too many tabs now.


More information about the textmate mailing list