… | |
… | |
187 | $self->enable (key_press => \&matchlist_key_press); |
187 | $self->enable (key_press => \&matchlist_key_press); |
188 | } |
188 | } |
189 | |
189 | |
190 | sub most_recent { |
190 | sub most_recent { |
191 | my ($self) = shift; |
191 | my ($self) = shift; |
192 | my $row = $self->nrow; |
192 | my $row = $self->nrow - 1; |
193 | my @exec; |
193 | my @exec; |
194 | while($row-- > $self->top_row) { |
194 | while ($row >= $self->top_row) { |
|
|
195 | my $line = $self->line ($row); |
195 | @exec = $self->command_for($row); |
196 | @exec = $self->command_for($row); |
196 | last if(@exec); |
197 | last if(@exec); |
|
|
198 | |
|
|
199 | $row = $line->beg - 1; |
197 | } |
200 | } |
198 | if(@exec) { |
201 | if(@exec) { |
199 | return $self->exec_async (@exec); |
202 | return $self->exec_async (@exec); |
200 | } |
203 | } |
201 | () |
204 | () |
… | |
… | |
263 | my ($self, $row) = @_; |
266 | my ($self, $row) = @_; |
264 | |
267 | |
265 | # fetch the line that has changed |
268 | # fetch the line that has changed |
266 | my $line = $self->line ($row); |
269 | my $line = $self->line ($row); |
267 | my $text = $line->t; |
270 | my $text = $line->t; |
|
|
271 | my $rend; |
268 | |
272 | |
269 | # find all urls (if any) |
273 | # find all urls (if any) |
270 | for my $matcher (@{$self->{matchers}}) { |
274 | for my $matcher (@{$self->{matchers}}) { |
271 | while ($text =~ /$matcher->[0]/g) { |
275 | while ($text =~ /$matcher->[0]/g) { |
272 | #print "$&\n"; |
276 | #print "$&\n"; |
273 | my $rend = $line->r; |
277 | $rend ||= $line->r; |
274 | |
278 | |
275 | # mark all characters as underlined. we _must_ not toggle underline, |
279 | # mark all characters as underlined. we _must_ not toggle underline, |
276 | # as we might get called on an already-marked url. |
280 | # as we might get called on an already-marked url. |
277 | &{$matcher->[2]} |
281 | &{$matcher->[2]} |
278 | for @{$rend}[$-[0] .. $+[0] - 1]; |
282 | for @{$rend}[$-[0] .. $+[0] - 1]; |
279 | |
|
|
280 | $line->r ($rend); |
|
|
281 | } |
283 | } |
282 | } |
284 | } |
|
|
285 | |
|
|
286 | $line->r ($rend) if $rend; |
283 | |
287 | |
284 | () |
288 | () |
285 | } |
289 | } |
286 | |
290 | |
287 | sub valid_button { |
291 | sub valid_button { |