--- rxvt-unicode/src/perl/matcher 2015/03/17 09:25:16 1.35 +++ rxvt-unicode/src/perl/matcher 2021/11/21 17:08:57 1.38 @@ -39,7 +39,7 @@ or copy them to the clipboard. While the mode is active, normal terminal input/output is suspended and the following bindings are recognized: -=over 4 +=over =item C @@ -93,9 +93,9 @@ my $url = qr{ (?:https?://|ftp://|news://|mailto:|file://|\bwww\.) - [\w\-\@;\/?:&=%\$.+!*\x27,~#]* + [\w\-\@;\/?:&=%\$.+!*\x27,~#$urxvt::NOCHAR]* ( - \([\w\-\@;\/?:&=%\$.+!*\x27,~#]*\)| # Allow a pair of matched parentheses + \([\w\-\@;\/?:&=%\$.+!*\x27,~#$urxvt::NOCHAR]*\)| # Allow a pair of matched parentheses [\w\-\@;\/?:&=%\$+*~] # exclude some trailing characters (heuristic) )+ }x; @@ -253,9 +253,7 @@ my @defaults = ($url); my @matchers; - for (my $idx = 0; defined (my $res = $self->my_resource ("pattern.$idx") || $defaults[$idx]); $idx++) { - $res = $self->locale_decode ($res); - utf8::encode $res; + for (my $idx = 0; defined (my $res = $self->locale_decode ($self->my_resource ("pattern.$idx")) || $defaults[$idx]); $idx++) { my $launcher = $self->my_resource ("launcher.$idx"); $launcher =~ s/\$&|\$\{&\}/\${0}/g if $launcher; my $rend = $self->parse_rend($self->my_resource ("rend.$idx")); @@ -425,7 +423,7 @@ $self->{matches} = \@matches; $self->{cur_row} = $row; $self->{id} = $dir < 0 ? @{ $self->{matches} } - 1 : 0; - $self->view_start (List::Util::min 0, $row - ($self->nrow >> 1)); + $self->view_start ($row - ($self->nrow >> 1)); $self->want_refresh; return 1; }