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.29 by root, Sun Jun 10 17:31:53 2012 UTC vs.
Revision 1.33 by root, Sat May 17 15:25:04 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:BINDING:M-s:start
6 7
7=head1 NAME 8=head1 NAME
8 9
9 searchable-scrollback<hotkey> - incremental scrollback search (enabled by default) 10searchable-scrollback<hotkey> - incremental scrollback search (enabled by default)
10 11
11=head1 DESCRIPTION 12=head1 DESCRIPTION
12 13
13Adds regex search functionality to the scrollback buffer, triggered 14Adds regex search functionality to the scrollback buffer, triggered
14by a hotkey (default: C<M-s>). While in search mode, normal terminal 15by a hotkey (default: C<M-s>). While in search mode, normal terminal
32=cut 33=cut
33 34
34sub on_init { 35sub on_init {
35 my ($self) = @_; 36 my ($self) = @_;
36 37
38 # only for backwards compatibility
37 my $hotkey = $self->{argv}[0] 39 my $hotkey = $self->{argv}[0]
38 || $self->x_resource ("%") 40 || $self->x_resource ("%")
39 || "M-s"; 41 || "M-s";
40 42
41 $self->parse_keysym ($hotkey, "perl:searchable-scrollback:start") 43 $self->bind_action ($hotkey, "searchable-scrollback:start") # ugh
42 or warn "unable to register '$hotkey' as scrollback search start hotkey\n"; 44 or warn "unable to register '$hotkey' as scrollback search start hotkey\n";
43 45
44 () 46 ()
45} 47}
46 48
47sub on_user_command { 49sub on_action {
48 my ($self, $cmd) = @_; 50 my ($self, $action) = @_;
49 51
50 $cmd eq "searchable-scrollback:start" 52 $action eq "start"
51 and $self->enter; 53 and $self->enter;
52 54
53 () 55 ()
54} 56}
55 57

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines