aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--urxvt/ext/selection7
1 files changed, 5 insertions, 2 deletions
diff --git a/urxvt/ext/selection b/urxvt/ext/selection
index bb61eb56..d465d326 100644
--- a/urxvt/ext/selection
+++ b/urxvt/ext/selection
@@ -11,6 +11,7 @@ use utf8;
use 5.006;
use Carp;
+use English qw(-no_match_vars);
our $VERSION = 1.0;
@@ -49,8 +50,10 @@ sub on_sel_extend {
for my $regex ( @{ $self->{patterns} } ) {
while ( $text =~ /$regex/g ) {
- if ( $-[1] <= $markofs and $markofs <= $+[1] ) {
- my $ofs = $-[1];
+ if ( $LAST_MATCH_START[1] <= $markofs
+ and $markofs <= $LAST_MATCH_END[1] )
+ {
+ my $ofs = $LAST_MATCH_START[1];
my $match = $1;
push @matches, [ $ofs, length $match ];