--- trunk/lib/Frey/Web.pm 2008/11/28 13:25:17 584 +++ trunk/lib/Frey/Web.pm 2008/11/28 15:07:03 588 @@ -102,6 +102,8 @@ if ( $name =~ m{::} && $name !~ $re_html ) { return qq|$name $content\n|; + } elsif ( $name =~ s{^\s*($name $content\n|; } @@ -459,7 +461,9 @@ $level ||= $self->debug, my $path = $self->log_path; - my $warnings; + my $max = 50; + my $pos = 0; + my @warnings = ( '' x $max ); # XXX circualar buffer for 50 lines my $line = 0; my $multiline_end; @@ -470,6 +474,8 @@ my $style = ''; +=for filter + if ( $multiline_end ) { if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) { # warn "## $line end of $multiline_end in '$_'\n"; @@ -486,6 +492,9 @@ next; } +=cut + if ( m{^(#*)\s+} ) { # FIXME + $style = $warn_colors->{$1} ? ' style="color:' . $warn_colors->{$1} . '"' : ''; @@ -496,17 +505,30 @@ $msg = substr( $msg, 0, $self->html_dump_width ); $spacer = '…' } - $msg =~ s{^\s}{ }g; - $warnings .= qq|$msg$spacer+$line
|; + $warnings[ $pos++ % $max ] + = $msg +# = ( $style ? qq|$msg| : $msg ) + . $spacer + . qq|+$line
|; # FIXME should be but CSS hates me } } close($log) || die "can't close $path: $!"; + my $size = -s $path; + + my $warnings = join('', + map { $warnings[ ( $pos + $_ ) % $max ] || '' } 0 .. $max + ); + + my $s = length($warnings); + return - qq|warn| - . $self->editor_links( $warnings ) - . qq|| + # need to wrap into span so we can have links in warnings + qq|warn| + . $warnings +# . $self->editor_links( $warnings ) + . qq|| ; }