--- rxvt-unicode/src/perl/searchable-scrollback 2014/06/08 19:40:20 1.38 +++ rxvt-unicode/src/perl/searchable-scrollback 2014/12/26 18:58:19 1.42 @@ -3,7 +3,6 @@ # this extension implements scrollback buffer search #:META:RESOURCE:%:string:activation hotkey keysym -#:META:BINDING:M-s:start =head1 NAME @@ -38,14 +37,23 @@ # only for backwards compatibility my $hotkey = $self->{argv}[0] || $self->x_resource ("%") - || return; + || "M-s"; - $self->bind_action ($hotkey, "searchable-scrollback:start") # ugh + $self->bind_action ($hotkey, "searchable-scrollback:start") or warn "unable to register '$hotkey' as scrollback search start hotkey\n"; () } +sub on_user_command { + my ($self, $cmd) = @_; + + $cmd eq "searchable-scrollback:start" + and $self->enter; + + () +} + sub on_action { my ($self, $action) = @_; @@ -94,6 +102,7 @@ delete $self->{manpage_overlay}; delete $self->{overlay}; delete $self->{search}; + delete $self->{found}; } sub idle { @@ -124,14 +133,14 @@ $self->{row} = $row; $self->view_start (List::Util::min 0, $row - ($self->nrow >> 1)); $self->want_refresh; - last; + return; } $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; } } - $self->scr_bell unless $self->{found}; + $self->scr_bell; } sub refresh {