… | |
… | |
4 | |
4 | |
5 | #:META:RESOURCE:%:string:activation hotkey keysym |
5 | #:META:RESOURCE:%:string:activation hotkey keysym |
6 | |
6 | |
7 | =head1 NAME |
7 | =head1 NAME |
8 | |
8 | |
9 | searchable-scrollback - incremental scrollback search (enabled by default) |
9 | searchable-scrollback - incremental scrollback search |
10 | |
10 | |
11 | =head1 DESCRIPTION |
11 | =head1 DESCRIPTION |
12 | |
12 | |
13 | Adds regex search functionality to the scrollback buffer, triggered by |
13 | Adds regex search functionality to the scrollback buffer, triggered by |
14 | the C<searchable-scrollback:start> action (bound to C<M-s> by |
14 | the C<searchable-scrollback:start> action (bound to C<M-s> by |
… | |
… | |
16 | suspended and a regex is displayed at the bottom of the screen. |
16 | suspended and a regex is displayed at the bottom of the screen. |
17 | |
17 | |
18 | Inputting characters appends them to the regex and continues incremental |
18 | Inputting characters appends them to the regex and continues incremental |
19 | search. In addition, the following bindings are recognized: |
19 | search. In addition, the following bindings are recognized: |
20 | |
20 | |
21 | =over 4 |
21 | =over |
22 | |
22 | |
23 | =item C<BackSpace> |
23 | =item C<BackSpace> |
24 | |
24 | |
25 | Remove a character from the regex. |
25 | Remove a character from the regex. |
26 | |
26 | |
… | |
… | |
166 | do { |
166 | do { |
167 | push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[0])]; |
167 | push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[0])]; |
168 | } while $text =~ /$re/g; |
168 | } while $text =~ /$re/g; |
169 | |
169 | |
170 | $self->{row} = $row; |
170 | $self->{row} = $row; |
171 | $self->view_start (List::Util::min 0, $row - ($self->nrow >> 1)); |
171 | $self->view_start ($row - ($self->nrow >> 1)); |
172 | $self->want_refresh; |
172 | $self->want_refresh; |
173 | return; |
173 | return; |
174 | } |
174 | } |
175 | |
175 | |
176 | $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; |
176 | $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; |
… | |
… | |
221 | my $line = $self->line ($self->{row}); |
221 | my $line = $self->line ($self->{row}); |
222 | $self->search (+1, $line->end + 1) |
222 | $self->search (+1, $line->end + 1) |
223 | if $line->end < $self->nrow; |
223 | if $line->end < $self->nrow; |
224 | } elsif ($keysym == 0xff55) { # prior |
224 | } elsif ($keysym == 0xff55) { # prior |
225 | my $row = $self->view_start - ($self->nrow - 1); |
225 | my $row = $self->view_start - ($self->nrow - 1); |
226 | $self->view_start (List::Util::min 0, $row); |
226 | $self->view_start ($row); |
227 | } elsif ($keysym == 0xff56) { # next |
227 | } elsif ($keysym == 0xff56) { # next |
228 | my $row = $self->view_start + ($self->nrow - 1); |
228 | my $row = $self->view_start + ($self->nrow - 1); |
229 | $self->view_start (List::Util::min 0, $row); |
229 | $self->view_start ($row); |
230 | } elsif ($keysym == 0xff63) { # insert |
230 | } elsif ($keysym == 0xff63) { # insert |
231 | $self->selection_request (urxvt::CurrentTime, 1); |
231 | $self->selection_request (urxvt::CurrentTime, 1); |
232 | } elsif ($keysym == 0xff08) { # backspace |
232 | } elsif ($keysym == 0xff08) { # backspace |
233 | substr $self->{search}, -1, 1, ""; |
233 | substr $self->{search}, -1, 1, ""; |
234 | $self->search (+1, $self->{row}); |
234 | $self->search (+1, $self->{row}); |