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.24 by sf-exg, Thu Jun 12 19:29:28 2014 UTC vs.
Revision 1.25 by sf-exg, Fri Jun 13 21:49:19 2014 UTC

259 259
260sub find_matches { 260sub find_matches {
261 my ($self, $row, $col) = @_; 261 my ($self, $row, $col) = @_;
262 my $line = $self->line ($row); 262 my $line = $self->line ($row);
263 my $text = $line->t; 263 my $text = $line->t;
264 my $off = $line->offset_of ($row, $col) if $col;
264 265
265 my @matches; 266 my @matches;
266 for my $matcher (@{$self->{matchers}}) { 267 for my $matcher (@{$self->{matchers}}) {
267 my $launcher = $matcher->[1] || $self->{launcher}; 268 my $launcher = $matcher->[1] || $self->{launcher};
268 while ($text =~ /$matcher->[0]/g) { 269 while ($text =~ /$matcher->[0]/g) {
269 my $match = substr $text, $-[0], $+[0] - $-[0]; 270 my $match = substr $text, $-[0], $+[0] - $-[0];
270 my @begin = @-; 271 my @begin = @-;
271 my @end = @+; 272 my @end = @+;
272 my @exec; 273 my @exec;
273 274
274 if (!defined($col) || ($-[0] <= $col && $+[0] >= $col)) { 275 if (!defined($off) || ($-[0] <= $off && $+[0] >= $off)) {
275 if ($launcher !~ /\$/) { 276 if ($launcher !~ /\$/) {
276 @exec = ($launcher, $match); 277 @exec = ($launcher, $match);
277 } else { 278 } else {
278 # It'd be nice to just access a list like ($&,$1,$2...), 279 # It'd be nice to just access a list like ($&,$1,$2...),
279 # but alas, m//g behaves differently in list context. 280 # but alas, m//g behaves differently in list context.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines