I don't speak Perl, so I was just talking generally... but each of those \t's is a tab, so maybe remove two?
The only other thing I can think of is that $m1 there needs to be escaped-- its contents, like.
On 5/4/06, Oliver Taylor ollieman@gmail.com wrote:
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.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate