--- rxvt-unicode/src/perl/searchable-scrollback 2014/06/06 19:40:15 1.37 +++ rxvt-unicode/src/perl/searchable-scrollback 2014/06/09 19:40:42 1.39 @@ -105,8 +105,6 @@ sub search { my ($self, $dir, $row) = @_; - delete $self->{found}; - my $search = $self->special_encode ($self->{search}); no re 'eval'; # just to be sure @@ -117,6 +115,8 @@ my $text = $line->t; if ($text =~ /$re/g) { + delete $self->{found}; + do { push @{ $self->{found} }, [$line->coord_of ($-[0]), $line->coord_of ($+[0])]; } while $text =~ /$re/g; @@ -124,14 +124,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 { @@ -194,6 +194,7 @@ $self->{search} =~ s/^\(\?i\)// if $self->{search} =~ /^\(.*[[:upper:]]/; + delete $self->{found}; $self->search (-1, $self->{row}); $self->idle;