… | |
… | |
44 | 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"; |
45 | |
45 | |
46 | () |
46 | () |
47 | } |
47 | } |
48 | |
48 | |
|
|
49 | sub on_user_command { |
|
|
50 | my ($self, $cmd) = @_; |
|
|
51 | |
|
|
52 | $cmd eq "searchable-scrollback:start" |
|
|
53 | and $self->enter; |
|
|
54 | |
|
|
55 | () |
|
|
56 | } |
|
|
57 | |
49 | sub on_action { |
58 | sub on_action { |
50 | my ($self, $action) = @_; |
59 | my ($self, $action) = @_; |
51 | |
60 | |
52 | $action eq "start" |
61 | $action eq "start" |
53 | and $self->enter; |
62 | and $self->enter; |
… | |
… | |
92 | $self->pty_ev_events ($self->{pty_ev_events}); |
101 | $self->pty_ev_events ($self->{pty_ev_events}); |
93 | |
102 | |
94 | delete $self->{manpage_overlay}; |
103 | delete $self->{manpage_overlay}; |
95 | delete $self->{overlay}; |
104 | delete $self->{overlay}; |
96 | delete $self->{search}; |
105 | delete $self->{search}; |
|
|
106 | delete $self->{found}; |
97 | } |
107 | } |
98 | |
108 | |
99 | sub idle { |
109 | sub idle { |
100 | my ($self) = @_; |
110 | my ($self) = @_; |
101 | |
111 | |
… | |
… | |
122 | } while $text =~ /$re/g; |
132 | } while $text =~ /$re/g; |
123 | |
133 | |
124 | $self->{row} = $row; |
134 | $self->{row} = $row; |
125 | $self->view_start (List::Util::min 0, $row - ($self->nrow >> 1)); |
135 | $self->view_start (List::Util::min 0, $row - ($self->nrow >> 1)); |
126 | $self->want_refresh; |
136 | $self->want_refresh; |
127 | last; |
137 | return; |
128 | } |
138 | } |
129 | |
139 | |
130 | $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; |
140 | $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; |
131 | } |
141 | } |
132 | } |
142 | } |
133 | |
143 | |
134 | $self->scr_bell unless $self->{found}; |
144 | $self->scr_bell; |
135 | } |
145 | } |
136 | |
146 | |
137 | sub refresh { |
147 | sub refresh { |
138 | my ($self) = @_; |
148 | my ($self) = @_; |
139 | |
149 | |