ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/searchable-scrollback
(Generate patch)

Comparing rxvt-unicode/src/perl/searchable-scrollback (file contents):
Revision 1.27 by root, Wed Jun 6 15:06:41 2012 UTC vs.
Revision 1.32 by root, Sat May 17 13:38:23 2014 UTC

1#! perl 1#! perl
2 2
3# this extension implements scrollback buffer search 3# this extension implements scrollback buffer search
4 4
5#:META:X_RESOURCE:%:string:activation hotkey keysym 5#:META:RESOURCE:%:string:activation hotkey keysym
6#:META:KEYSYM:M-s:searchable-scrollback:start
7
8=head1 NAME
9
10searchable-scrollback<hotkey> - incremental scrollback search (enabled by default)
11
12=head1 DESCRIPTION
13
14Adds regex search functionality to the scrollback buffer, triggered
15by a hotkey (default: C<M-s>). While in search mode, normal terminal
16input/output is suspended and a regex is displayed at the bottom of the
17screen.
18
19Inputting characters appends them to the regex and continues incremental
20search. C<BackSpace> removes a character from the regex, C<Up> and C<Down>
21search upwards/downwards in the scrollback buffer, C<End> jumps to the
22bottom. C<Escape> leaves search mode and returns to the point where search
23was started, while C<Enter> or C<Return> stay at the current position and
24additionally stores the first match in the current line into the primary
25selection if the C<Shift> modifier is active.
26
27The regex defaults to "(?i)", resulting in a case-insensitive search. To
28get a case-sensitive search you can delete this prefix using C<BackSpace>
29or simply use an uppercase character which removes the "(?i)" prefix.
30
31See L<perlre> for more info about perl regular expression syntax.
32
33=cut
6 34
7sub on_init { 35sub on_init {
8 my ($self) = @_; 36 my ($self) = @_;
9 37
10 my $hotkey = $self->{argv}[0] 38 my $hotkey = $self->{argv}[0]
11 || $self->x_resource ("searchable-scrollback") 39 || $self->x_resource ("%")
12 || "M-s"; 40 || "M-s";
13 41
14 $self->parse_keysym ($hotkey, "perl:searchable-scrollback:start") 42 $self->parse_keysym ($hotkey, "perl:searchable-scrollback:start")
15 or warn "unable to register '$hotkey' as scrollback search start hotkey\n"; 43 or warn "unable to register '$hotkey' as scrollback search start hotkey\n";
16 44

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines