[TxMt] Re: Xmas Wish

Andy Armstrong andy at hexten.net
Mon Dec 22 15:32:55 UTC 2008


On 22 Dec 2008, at 15:27, Steve King wrote:
> while (<$fh>) {
>    chomp();
>    if (/^(.*?):(\d+):(\d+):\s*(error|warning):\s*(.*)$/) {
>        my $file = $1;
>        my $line = $2;
>        my $col  = $3;
>        my $type = $4;
>        my $msg  = $5;
>        $msg = encode_entities($msg);
>        my $color = ($type eq 'error') ? "red" : "yellow";
>        my $url = sprintf 'txmt://open/?url=file://%s&line=%d&column= 
> %d', $path, $line, $col;
>        $str = "<span style=\"background-color:$color\"><a href=\"$url 
> \">$file:$line:$col:</a> $type: $msg</span>";
>    }
>    else {
>        $str = encode_entities($_);
>    }
>    print $str . "<br>\n";
> }


Shameless plug:

http://search.cpan.org/dist/TextMate-JumpTo/

:)

-- 
Andy Armstrong, Hexten






More information about the textmate mailing list