[TxMt] QuickOpen included files

Juan Falgueras jfalgueras at uma.es
Fri Apr 20 18:59:41 UTC 2007



I have change the source of the list of paths for QuickOpen included  
files.  It works fine:

-----------------------------------
#!/usr/bin/env perl

# to know header paths for your precompiler do:
# echo | g++ -E -v -x c++ -
# and save the header paths as path1:path2:etc
# in the TM pref env variable TM_HEADER_SEARCH_PATHS

$hpaths = $ENV{'TM_HEADER_SEARCH_PATHS'};

$line=$ENV{'TM_CURRENT_LINE'};
$header=$ENV{'TM_SELECTED_TEXT'};

if (!$header) {
   $line =~ /#\s*include\s*([<"])(.*?)[">]/;
   $local = $1;
   $header = $2;
}

if ($local eq '"') {
   $t = $ENV{'TM_DIRECTORY'};
   if (-f "$t/$header" ) {
     print "$t/$header";
     system("mate -r \"$t/$header\"");
     exit 0;
   }
}

@incs = split(/:/, $hpaths);

foreach $t (@incs) {
   if (-f "$t/$header") {
     print "$t/$header";
     system("mate -r \"$t/$header\"");
     exit 0;
   }
}
print "";
exit 1;
-----------------------------------

Juan F.




More information about the textmate mailing list