--- rxvt-unicode/src/perl/matcher 2014/06/22 07:51:21 1.31 +++ rxvt-unicode/src/perl/matcher 2014/10/13 19:39:42 1.33 @@ -189,11 +189,14 @@ sub most_recent { my ($self) = shift; - my $row = $self->nrow; + my $row = $self->nrow - 1; my @exec; - while($row-- > $self->top_row) { + while ($row >= $self->top_row) { + my $line = $self->line ($row); @exec = $self->command_for($row); last if(@exec); + + $row = $line->beg - 1; } if(@exec) { return $self->exec_async (@exec); @@ -265,22 +268,23 @@ # fetch the line that has changed my $line = $self->line ($row); my $text = $line->t; + my $rend; # find all urls (if any) for my $matcher (@{$self->{matchers}}) { while ($text =~ /$matcher->[0]/g) { #print "$&\n"; - my $rend = $line->r; + $rend ||= $line->r; # mark all characters as underlined. we _must_ not toggle underline, # as we might get called on an already-marked url. &{$matcher->[2]} for @{$rend}[$-[0] .. $+[0] - 1]; - - $line->r ($rend); } } + $line->r ($rend) if $rend; + () }