-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 715135dbaf7d156ae275dd5cbc41917030090c6a:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 715135dbaf7d156ae275dd5cbc41917030090c6a
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Sat Jun 7 20:07:38 2014 +0000

    Make matcher:list really compute the 10 'most recent' matches.

diff --git a/src/perl/matcher b/src/perl/matcher

index 5dd868c5d4c55788e6a107f11dc20812e54e0605..

index ..e120d7b6806c95441f37538fc3cd0036c54b3db9 100644

--- a/src/perl/matcher
+++ b/src/perl/matcher
@@ -104,6 +104,7 @@ sub matchlist {
       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 @@ sub matchlist {
                   /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;
    }

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Nov 10 19:47:10 2024