From b4cb2c13839b021b46a16dd139c5b95f22f63448 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 19 Jun 2016 11:26:23 +1200 Subject: Remove @mark_patterns/@simplify_patterns --- urxvt/ext/selection | 54 +---------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'urxvt') diff --git a/urxvt/ext/selection b/urxvt/ext/selection index fe3bc3af..cf8dd142 100644 --- a/urxvt/ext/selection +++ b/urxvt/ext/selection @@ -22,51 +22,6 @@ sub on_init { () } -# "find interesting things"-patterns -my @mark_patterns = ( -# qr{ ([[:word:]]+) }x, - qr{ ([^[:space:]]+) }x, - - # common types of "parentheses" - qr{ (?]+) \> }x, - - # urls, just a heuristic - qr{( - (?:https?://|ftp://|news://|mailto:|file://|\bwww\.)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~#]+ - [ab-zA-Z0-9\-\@;\/?:&=%\$_+*()~] # exclude some trailing characters (heuristic) - )}x, - - # shell-like argument quoting, basically always matches - qr{\G [\ \t|&;<>()]* ( - (?: - [^\\"'\ \t|&;<>()]+ - | \\. - | " (?: [^\\"]+ | \\. )* " - | ' [^']* ' - )+ - )}x, -); - -# "correct obvious? crap"-patterns -my @simplify_patterns = ( - qr{^"([^\\"'\ \t|&;<>()*?]+)"$}, # "simple" => simple - qr{^(.*)[,\-]$}, # strip off trailing , and - -); - sub on_sel_extend { my ($self, $time) = @_; @@ -85,19 +40,12 @@ sub on_sel_extend { if ($markofs < $line->l) { study $text; # _really_ helps, too :) - for my $regex (@mark_patterns, @{ $self->{patterns} }) { + for my $regex ( @{ $self->{patterns} }) { while ($text =~ /$regex/g) { if ($-[1] <= $markofs and $markofs <= $+[1]) { my $ofs = $-[1]; my $match = $1; - for my $regex (@simplify_patterns) { - if ($match =~ $regex) { - $match = $1; - $ofs += $-[1]; - } - } - push @matches, [$ofs, length $match]; } } -- cgit v1.2.3