diff options
-rw-r--r-- | reselect | 27 |
1 files changed, 6 insertions, 21 deletions
@@ -107,32 +107,17 @@ sub on_action { my $base_col = 0; my $text = ''; - my ($brow, $bcol) = $self->selection_beg(); - my ($erow, $ecol) = $self->selection_end(); - my $issel = ($ecol > $bcol) || ($erow > $brow); - if ($issel) { # restrict to selection if one exists - ($row, $base_col) = ($brow - $self->view_start, $bcol); - for (split(/\n/, $self->selection())) { - my $start = length($text) - $base_col; - $text .= $_; - $rowmap->{$row} = [$start, (length($text)-1)]; - $base_col = 0; - $row++; - } - } else { # no selection, use visible terminal - for (0..($self->nrow - 1)) { - $row = $_; - my $start = length($text); - $text .= $self->ROW_t($row + $self->view_start); - $rowmap->{$row} = [$start, (length($text)-1)]; - } + for (0..($self->nrow - 1)) { + $row = $_; + my $start = length($text); + $text .= $self->ROW_t($row + $self->view_start); + $rowmap->{$row} = [$start, (length($text)-1)]; } my $results = $self->build_overlays($pattern, $text, $rowmap); if (keys %{$results} < 1) { - my $desc = $issel ? "in visible selected text" : "on visible screen"; - $self->status_msg("no matches found $desc"); + $self->status_msg("no matches found"); } else { my $url_picker = {}; |