--- rxvt-unicode/src/perl/matcher 2014/06/01 11:47:20 1.18 +++ rxvt-unicode/src/perl/matcher 2014/06/07 20:07:38 1.19 @@ -104,6 +104,7 @@ my $text = $line->t; # FIXME: code duplicated from 'command_for' + my @matches; for my $matcher (@{$self->{matchers}}) { my $launcher = $matcher->[1] || $self->{launcher}; while ($text =~ /$matcher->[0]/g) { @@ -120,10 +121,16 @@ /egx; $_ } split /\s+/, $launcher; } - push @{ $self->{matches} }, [ $match, @exec ]; + push @matches, [ $beg[0], $match, @exec ]; } } + for (sort { $b->[0] <=> $a->[0] } @matches) { + shift @$_; + push @{ $self->{matches} }, $_; + last if @{ $self->{matches} } == 10; + } + $row = $line->beg - 1; }