--- rxvt-unicode/src/perl/matcher 2014/10/14 09:00:43 1.34 +++ rxvt-unicode/src/perl/matcher 2015/03/17 09:25:16 1.35 @@ -34,7 +34,7 @@ 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 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 @@ =back +It is also possible to cycle through the matches using a key +combination bound to the C action. + Example: load and use the matcher extension with defaults. URxvt.perl-ext: default,matcher @@ -424,13 +427,15 @@ $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 @@ $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