aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-02 10:31:29 +0100
committerAnton Khirnov <anton@khirnov.net>2021-11-02 10:31:29 +0100
commit8108c454e3133de2d9291c1bc58ef8c32e80fc6a (patch)
tree6a2f3ab2a10c8d3e9f80955b48bf0724620630f0
parent7d020150b097dc199c40d3ca22c92b243720cef5 (diff)
Rename href to match.
This extension is no longer limited to just URLs.
-rw-r--r--reselect17
1 files changed, 10 insertions, 7 deletions
diff --git a/reselect b/reselect
index 2bc19d0..d0f9af1 100644
--- a/reselect
+++ b/reselect
@@ -2,6 +2,9 @@
# Author: Chip Camden <sterling@camdensoftware.com>
+
+use English;
+
my @hintchars = split //,'jfkdlsahgiroemcx';
my $re_url =
@@ -48,7 +51,7 @@ sub find_matches {
my @matches;
while ($text =~ /$pattern/g) {
my $ndx = $-[0];
- my $href = $&;
+ my $match = $MATCH;
my $col = 0;
my $row = 0;
@@ -62,7 +65,7 @@ sub find_matches {
}
}
if ($row >= 0) {
- push(@matches, [$col, $row, $href]);
+ push(@matches, [$col, $row, $match]);
}
}
@@ -81,14 +84,14 @@ sub build_overlays {
my $hints = hint_iterator();
for my $ov (@overlays) {
- my ($col, $row, $href) = @$ov;
+ my ($col, $row, $match) = @$ov;
my $hint = $hints->();
my $overlay = $self->overlay($col, $row, $self->strwidth($hint),
1, $label_rend, 0);
$overlay->set(0, 0, $hint);
- $results->{$hint} = {label => $overlay, match => $href};
+ $results->{$hint} = {label => $overlay, match => $match};
}
return $results;
@@ -204,14 +207,14 @@ sub update {
}
sub launch {
- my ($self, $href) = @_;
+ my ($self, $match) = @_;
my $p = $self->{url_picker};
$self->screen_cur($p->{crow},$p->{ccol});
$self->{url_picker} = ();
- $self->status_msg($href);
+ $self->status_msg($match);
- $self->selection($href, 1);
+ $self->selection($match, 1);
$self->selection_grab(urxvt::CurrentTime, 1);
}