aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsf-exg <sf-exg>2017-10-24 20:12:08 +0000
committersf-exg <sf-exg>2017-10-24 20:12:08 +0000
commitfb7ef3092549adb8bb7d062e986e6f0f6a805c41 (patch)
tree6a0e8d70e7fa4ac4776df180792eb9e47317557e
parentbe75d1a5dc18c1169bad44310f465f1836f57805 (diff)
downloadrxvt-unicode-fb7ef3092549adb8bb7d062e986e6f0f6a805c41.tar
rxvt-unicode-fb7ef3092549adb8bb7d062e986e6f0f6a805c41.tar.gz
searchable-scrollback: add bindings for scrolling and pastingHEADmaster
-rw-r--r--src/perl/searchable-scrollback57
1 files changed, 51 insertions, 6 deletions
diff --git a/src/perl/searchable-scrollback b/src/perl/searchable-scrollback
index 60f18522..7c944900 100644
--- a/src/perl/searchable-scrollback
+++ b/src/perl/searchable-scrollback
@@ -16,12 +16,49 @@ default). While in search mode, normal terminal input/output is
suspended and a regex is displayed at the bottom of the screen.
Inputting characters appends them to the regex and continues incremental
-search. C<BackSpace> removes a character from the regex, C<Up> and C<Down>
-search upwards/downwards in the scrollback buffer, C<End> jumps to the
-bottom. C<Escape> leaves search mode and returns to the point where search
-was started, while C<Enter> or C<Return> stay at the current position and
-additionally stores the first match in the current line into the primary
-selection if the C<Shift> modifier is active.
+search. In addition, the following bindings are recognized:
+
+=over 4
+
+=item C<BackSpace>
+
+Remove a character from the regex.
+
+=item C<Insert>
+
+Append the value of the PRIMARY selection to the regex.
+
+=item C<Up>
+
+Search for a match upwards.
+
+=item C<Down>
+
+Search for a match downwards.
+
+=item C<Prior>
+
+Scroll up.
+
+=item C<Next>
+
+Scroll down.
+
+=item C<End>
+
+Scroll to the bottom.
+
+=item C<Escape>
+
+Leave the mode and return to the point where search was started.
+
+=item C<Enter> or C<Return>
+
+Leave the mode maintaining the current position in the scrollback.
+Additionally, if the C<Shift> modifier is active, store the first
+match in the current line into the primary selection.
+
+=back
The regex defaults to "(?i)", resulting in a case-insensitive search. To
get a case-sensitive search you can delete this prefix using C<BackSpace>
@@ -184,6 +221,14 @@ sub key_press {
my $line = $self->line ($self->{row});
$self->search (+1, $line->end + 1)
if $line->end < $self->nrow;
+ } elsif ($keysym == 0xff55) { # prior
+ my $row = $self->view_start - ($self->nrow - 1);
+ $self->view_start (List::Util::min 0, $row);
+ } elsif ($keysym == 0xff56) { # next
+ my $row = $self->view_start + ($self->nrow - 1);
+ $self->view_start (List::Util::min 0, $row);
+ } elsif ($keysym == 0xff63) { # insert
+ $self->selection_request (urxvt::CurrentTime, 1);
} elsif ($keysym == 0xff08) { # backspace
substr $self->{search}, -1, 1, "";
$self->search (+1, $self->{row});