Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Enhance look, add debug support

  • Loading branch information...
commit 2130d3266618585ce6704b2d87a222e127a1511d 1 parent bdeb640
authored January 26, 2012

Showing 1 changed file with 38 additions and 21 deletions. Show diff stats Hide diff stats

  1. 59  Support/bin/tmctags
59  Support/bin/tmctags
@@ -39,6 +39,8 @@
39 39
 	
40 40
 	use strict;
41 41
 	
  42
+	our $DEBUG=0;
  43
+	
42 44
 	our $TagFileName=&setFromEnv('TmCtagsTagFileName','tmtags');
43 45
 	our $CtagsFlags="--config-filename=tm_ctags --fields=Kn --excmd=pattern -R";
44 46
 	our $CtagsOptFlags=&setFromEnv('TmCtagsFlags','');
@@ -185,10 +187,14 @@ sub getQuotedDirs {
185 187
     return @quotedDirs;
186 188
 }
187 189
 sub updateTags {
  190
+	
188 191
 	my $dir=&tagsDir();
189 192
 	
190 193
 	my $ctags=&findCtagsPGM();
191 194
 	
  195
+	&playSoundNamed('Frog');
  196
+	
  197
+	
192 198
 	#
193 199
 	# The old way with system is problematic because occasionally
194 200
 	# ctags just hangs (various scanner bugs) and eats up CPU cycles
@@ -313,8 +319,29 @@ sub extractMSig {
313 319
 	# print "<br>WORD : '$word'<br>\n";
314 320
 	$word;
315 321
 }
316  
-
317 322
 sub findTags {
  323
+	
  324
+	my $originalFH=undef;
  325
+	
  326
+	if($DEBUG)
  327
+	{
  328
+		open(OUT,">/tmp/tmctags.html") or die("Can't open '/tmp/tmctags.html' for write: $!\n");
  329
+		
  330
+		$originalFH=select(OUT);
  331
+	}
  332
+	
  333
+	&_findTags;
  334
+	
  335
+	if($DEBUG)
  336
+	{
  337
+		close(OUT);
  338
+		select($originalFH);
  339
+		
  340
+		exec('cat /tmp/tmctags.html');
  341
+	}
  342
+}
  343
+
  344
+sub _findTags {
318 345
 		
319 346
 	my $word=$ENV{'TM_CURRENT_WORD'} or die("Missing 'TM_CURRENT_WORD' environment!\n");
320 347
 	my $srchStrt=0;
@@ -511,7 +538,7 @@ sub findTags {
511 538
 			print <<"HTML";
512 539
 <dt>
513 540
 <span class="filename"><a href="txmt://open?url=file://$file&line=$lno">$filename:$lno -- $path</a></span><br>
514  
-<span class="code">$code</span>
  541
+<div class="code">$code</div>
515 542
 </dt>
516 543
 HTML
517 544
 			if(!$lastFile || !$isHeader)
@@ -535,7 +562,7 @@ HTML
535 562
 		
536 563
 	}
537 564
 	
538  
-	my $history.=qq{<dt><span class="filename"><a href="txmt://open?url=file://$ENV{'TM_FILEPATH'}&line=$ENV{'TM_LINE_NUMBER'}">$ENV{'TM_FILENAME'}:$ENV{'TM_LINE_NUMBER'} -- $ENV{'TM_DIRECTORY'}</a></span><br><span class="code">$ENV{'TM_CURRENT_LINE'}</span></dt>\n};
  565
+	my $history.=qq{<dt><span class="filename"><a href="txmt://open?url=file://$ENV{'TM_FILEPATH'}&line=$ENV{'TM_LINE_NUMBER'}">$ENV{'TM_FILENAME'}:$ENV{'TM_LINE_NUMBER'} -- $ENV{'TM_DIRECTORY'}</a></span><br><div class="code">$ENV{'TM_CURRENT_LINE'}</div></dt>\n};
539 566
 	
540 567
 	if($CtagsHistorySize>1)
541 568
 	{
@@ -560,7 +587,6 @@ HTML
560 587
 	
561 588
 	&playSoundNamed($sound);
562 589
 }
563  
-
564 590
 sub pHeader
565 591
 {
566 592
 	my $word=shift;
@@ -572,13 +598,14 @@ sub pHeader
572 598
 <title>Tags for $tagPrefix$word</title>
573 599
 <style type="text/css">
574 600
 body {
575  
-	font-family: 'Trebuchet MS', 'Arial','Helvetica','sans-serif';
  601
+	font-family: 'Helvetica','Arial','sans-serif';
576 602
 	font-size: 12;
577  
-	background-color: #eeeeee;
  603
+	background-color: #ffffff;
578 604
 }
579 605
 
580 606
 a {
581 607
 	text-decoration: none;
  608
+	color: #888888;
582 609
 }
583 610
 
584 611
 a:hover {
@@ -591,37 +618,27 @@ a:hover {
591 618
 }
592 619
 
593 620
 .filename {
594  
-	font-family: 'Trebuchet MS', 'Arial','Helvetica','sans-serif';
595  
-	font-weight: bold;
596 621
 	font-size: 10;
597 622
 }
598 623
 
599 624
 .code {
600 625
 	font-family: 'Monaco', 'courier','serif';
  626
+	margin-top: 4px;
  627
+	margin-bottom: 4px;
  628
+	margin-left: 12px;
601 629
 }
602 630
 
603 631
 dt {
604 632
 	margin-top: 0px;
605 633
 	margin-bottom: 0px;
606  
-	padding-top: 2px;
607  
-	padding-bottom: 2px;
  634
+	padding: 4px;
608 635
 }
609 636
 dt:nth-child(odd) {
610  
-	background-color: #ffffff;
  637
+	background-color: #f4f7fa;
611 638
 }
612 639
 dl:nth-child(even) {
613  
-	background-color: #eeeeee;
614  
-}
615  
-
616  
-.summary {
617  
-	border: thin solid #000000;
618 640
 	background-color: #ffffff;
619  
-	margin-top: 10px;
620  
-	padding: 4px;
621  
-	font-family: 'Trebuchet MS', 'Arial','Helvetica','sans-serif';
622  
-	font-size: 9;
623 641
 }
624  
-
625 642
 </style>
626 643
 </head>
627 644
 <body>

0 notes on commit 2130d32

Please sign in to comment.
Something went wrong with that request. Please try again.