--- rxvt-unicode/src/perl/searchable-scrollback 2014/05/17 13:34:43 1.31 +++ rxvt-unicode/src/perl/searchable-scrollback 2014/05/31 08:33:47 1.36 @@ -2,19 +2,19 @@ # this extension implements scrollback buffer search -#:META:X_RESOURCE:%:string:activation hotkey keysym -#:META:KEYSYM:M-s:searchable-scrollback:start +#:META:RESOURCE:%:string:activation hotkey keysym +#:META:BINDING:M-s:start =head1 NAME -searchable-scrollback - incremental scrollback search (enabled by default) +searchable-scrollback - incremental scrollback search (enabled by default) =head1 DESCRIPTION -Adds regex search functionality to the scrollback buffer, triggered -by a hotkey (default: C). While in search mode, normal terminal -input/output is suspended and a regex is displayed at the bottom of the -screen. +Adds regex search functionality to the scrollback buffer, triggered by +the C action (bound to C by +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 removes a character from the regex, C and C @@ -35,20 +35,21 @@ sub on_init { my ($self) = @_; + # only for backwards compatibility my $hotkey = $self->{argv}[0] || $self->x_resource ("%") - || "M-s"; + || return; - $self->parse_keysym ($hotkey, "perl:searchable-scrollback:start") + $self->bind_action ($hotkey, "searchable-scrollback:start") # ugh or warn "unable to register '$hotkey' as scrollback search start hotkey\n"; () } -sub on_user_command { - my ($self, $cmd) = @_; +sub on_action { + my ($self, $action) = @_; - $cmd eq "searchable-scrollback:start" + $action eq "start" and $self->enter; () @@ -92,7 +93,6 @@ delete $self->{manpage_overlay}; delete $self->{overlay}; - delete $self->{history}; delete $self->{search}; }