ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/matcher
(Generate patch)

Comparing rxvt-unicode/src/perl/matcher (file contents):
Revision 1.32 by sf-exg, Wed Jul 30 15:22:51 2014 UTC vs.
Revision 1.33 by sf-exg, Mon Oct 13 19:39:42 2014 UTC

266 my ($self, $row) = @_; 266 my ($self, $row) = @_;
267 267
268 # fetch the line that has changed 268 # fetch the line that has changed
269 my $line = $self->line ($row); 269 my $line = $self->line ($row);
270 my $text = $line->t; 270 my $text = $line->t;
271 my $rend;
271 272
272 # find all urls (if any) 273 # find all urls (if any)
273 for my $matcher (@{$self->{matchers}}) { 274 for my $matcher (@{$self->{matchers}}) {
274 while ($text =~ /$matcher->[0]/g) { 275 while ($text =~ /$matcher->[0]/g) {
275 #print "$&\n"; 276 #print "$&\n";
276 my $rend = $line->r; 277 $rend ||= $line->r;
277 278
278 # mark all characters as underlined. we _must_ not toggle underline, 279 # mark all characters as underlined. we _must_ not toggle underline,
279 # as we might get called on an already-marked url. 280 # as we might get called on an already-marked url.
280 &{$matcher->[2]} 281 &{$matcher->[2]}
281 for @{$rend}[$-[0] .. $+[0] - 1]; 282 for @{$rend}[$-[0] .. $+[0] - 1];
282
283 $line->r ($rend);
284 } 283 }
285 } 284 }
285
286 $line->r ($rend) if $rend;
286 287
287 () 288 ()
288} 289}
289 290
290sub valid_button { 291sub valid_button {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines