… | |
… | |
90 | do { |
90 | do { |
91 | push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[0])]; |
91 | push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[0])]; |
92 | } while $text =~ /$re/g; |
92 | } while $text =~ /$re/g; |
93 | |
93 | |
94 | $self->{row} = $row; |
94 | $self->{row} = $row; |
95 | $self->view_start (-$row + ($self->nrow >> 1)); |
95 | $self->view_start (List::Util::max 0, -$row + ($self->nrow >> 1)); |
96 | $self->want_refresh; |
96 | $self->want_refresh; |
97 | last; |
97 | last; |
98 | } |
98 | } |
99 | |
99 | |
100 | $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; |
100 | $row = $dir < 0 ? $line->beg - 1 : $line->end + 1; |
… | |
… | |
104 | $self->scr_bell unless $self->{found}; |
104 | $self->scr_bell unless $self->{found}; |
105 | } |
105 | } |
106 | |
106 | |
107 | sub refresh { |
107 | sub refresh { |
108 | my ($self) = @_; |
108 | my ($self) = @_; |
|
|
109 | |
|
|
110 | return unless $self->{found}; |
109 | |
111 | |
110 | my $xor = urxvt::RS_RVid | urxvt::RS_Blink; |
112 | my $xor = urxvt::RS_RVid | urxvt::RS_Blink; |
111 | for (@{ $self->{found} }) { |
113 | for (@{ $self->{found} }) { |
112 | $self->scr_xor_span (@$_, $xor); |
114 | $self->scr_xor_span (@$_, $xor); |
113 | $xor = urxvt::RS_RVid; |
115 | $xor = urxvt::RS_RVid; |