[TxMt] New bundle: CTags

Oscar Bonilla ob at bitmover.com
Thu Jun 29 05:23:41 UTC 2006


Gerd,

Thanks for doing this! This is awesome!

Having said that... I hacked a little patch that makes it jump to the  
first tag if it's the only one... it's a little hackish, but you get  
the idea

--- tmctags	2006-06-28 11:41:05.000000000 -0700
+++ /Users/ob/tmp/tmctags.ob	2006-06-28 22:21:45.000000000 -0700
@@ -142,7 +142,6 @@
sub findTags {
	my $word=$ENV{'TM_CURRENT_WORD'} or die("Missing 'TM_CURRENT_WORD'  
environment!\n");
	
-	&pHeader($word);
	
	my $srch="$word\t";
	my @lines=();
@@ -170,10 +169,47 @@
	
	if(scalar(@lines)==0)
	{
+		&pHeader($word);
+		
		print "No tags found.\n";
	}
+	elsif(scalar(@lines)==1)
+	{
+		# redirect straight to the file
+		my $line=$lines[0];
+		my $idx1=index($line,"\t/^");
+		my $idx2=rindex($line,"/;\"");
+		my $code=substr($line,$idx1+3,$idx2-$idx1-3);
+		$line=substr($line,0,$idx1).substr($line,$idx2+3);
+		$code=~s/\$$//;
+		
+		my($w,$file,$type,$lno)=split("\t",$line);
+		if($lno=~/line\:(\d+)/)
+		{
+			$lno=$1;
+		}
+		else
+		{
+			$lno=1;
+		}
+		
+		$file=~/(.*)\/(.+)/;
+		my $path=$1;
+		my $filename=$2;
+		print <<"HTML";
+<html>
+<head>
+<meta http-equiv="Refresh" content="0; url=txmt://open?url=file:// 
$file&line=$lno">
+</meta>
+<body></body>
+</html>
+HTML
+		
+	}
	else
	{
+		&pHeader($word);
+		
		my $outLineNo=0;
		foreach my $line (@lines)
		{

What do you think?


On Jun 28, 2006, at 4:33 PM, Gerd Knops wrote:

>
> On Jun 28, 2006, at 4:42 PM, Eric Coleman wrote:
>
>> On Jun 28, 2006, at 4:56 PM, Gerd Knops wrote:
>>
>>> Does
>>>
>>> 	/usr/bin/perl -V
>>>
>>> in a terminal window work?
>>
>> eric at calista ~$ /usr/bin/perl -V
>> Summary of my perl5 (revision 5 version 8 subversion 6)  
>> configuration:
>> ...
> Thanks.
>
> I updated the bundle:
>
> 	http://gerd.knops.org/files/CTags.tmbundle.zip
>
> Can you give that a try?
>
> Thanks
>
> Gerd
>
>
>
> ______________________________________________________________________
> 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

--
pgp fingerprint: BC64 2E7A CAEF 39E1 9544  80CA F7D5 784D FB46 16C1




More information about the textmate mailing list