aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-02 10:23:11 +0100
committerAnton Khirnov <anton@khirnov.net>2021-11-02 10:23:11 +0100
commit7d020150b097dc199c40d3ca22c92b243720cef5 (patch)
tree606ab083bba717281052d12a450307e14ccd9f3a
parentd36fcaad2a726fa49cd3573a18261dc2b32e2a81 (diff)
Drop search-in-selection feature.
It is not useful to me and just gets in the way.
-rw-r--r--reselect27
1 files changed, 6 insertions, 21 deletions
diff --git a/reselect b/reselect
index 7f3bf79..2bc19d0 100644
--- a/reselect
+++ b/reselect
@@ -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 = {};