-- 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: 646cf138326872a3672abe25e6ef543cd42624f8:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit 646cf138326872a3672abe25e6ef543cd42624f8
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Tue Mar 17 09:25:16 2015 +0000

    Add support in matcher to cycle through the matches with a key combination bound to 'matcher:select'.

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

index 96f0b77eeb6b0631f14f23ded2c11ba675bfaf1d..

index ..d991d68ac5b0375312fc088850f0edb7ad742343 100644

--- a/src/perl/matcher
+++ b/src/perl/matcher
@@ -34,7 +34,7 @@ It is possible to activate the most recently seen match or a list of matches
 from the keyboard.  Simply bind a keysym to "matcher:last" or
 "matcher:list" as seen in the example below.

-The 'matcher:select' action enables a mode in which it is possible to
+The C<matcher:select> action enables a mode in which it is possible to
 iterate over the matches using the keyboard and either activate them
 or copy them to the clipboard. While the mode is active, normal terminal
 input/output is suspended and the following bindings are recognized:
@@ -71,6 +71,9 @@ Copy the current match to the clipboard.

 =back

+It is also possible to cycle through the matches using a key
+combination bound to the C<matcher:select> action.
+
 Example: load and use the matcher extension with defaults.

     URxvt.perl-ext:           default,matcher
@@ -424,13 +427,15 @@ sub select_search {
          $self->{id} = $dir < 0 ? @{ $self->{matches} } - 1 : 0;
          $self->view_start (List::Util::min 0, $row - ($self->nrow >> 1));
          $self->want_refresh;
-         return;
+         return 1;
       }

       $row = $dir < 0 ? $line->beg - 1 : $line->end + 1;
    }

    $self->scr_bell;
+
+   ()
 }

 sub select_refresh {
@@ -484,6 +489,15 @@ sub select_key_press {
          $self->select_search (+1, $line->end + 1)
             if $line->end < $self->nrow;
       }
+   } elsif ($self->lookup_keysym ($keysym, $event->{state}) eq "matcher:select") {
+      if ($self->{id} > 0) {
+         $self->{id}--;
+         $self->want_refresh;
+      } else {
+         my $line = $self->line ($self->{cur_row});
+         $self->select_search (-1, $self->nrow - 1)
+            unless $self->select_search (-1, $line->beg - 1);
+      }
    }

    1

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

-- Response ended

-- Page fetched on Sun Jun 2 12:51:35 2024