ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/selection
(Generate patch)

Comparing rxvt-unicode/src/perl/selection (file contents):
Revision 1.38 by root, Sat May 20 18:17:38 2006 UTC vs.
Revision 1.42 by root, Mon Nov 19 09:13:47 2007 UTC

32 () 32 ()
33} 33}
34 34
35# "find interesting things"-patterns 35# "find interesting things"-patterns
36my @mark_patterns = ( 36my @mark_patterns = (
37 qr{ ([[:word:]]+) }x,
38 qr{ ([^[:space:]]+) }x,
39
37 # common types of "parentheses" 40 # common types of "parentheses"
38 qr{ (?<![^[:space:]]) ‘ ([^‘’]+) ’ (?![^[:space]]) }x, 41 qr{ (?<![^[:space:]]) ‘ ([^‘’]+) ’ (?![^[:space:]]) }x,
39 qr{ (?<![^[:space:]]) ` ([^`']+) ' (?![^[:space]]) }x, 42 qr{ (?<![^[:space:]]) ` ([^`']+) ' (?![^[:space:]]) }x,
40 qr{ (?<![^[:space:]]) (" [^[:space:]] [^"]* ") }x, 43 qr{ (?<![^[:space:]]) (" [^[:space:]] [^"]* ") }x,
41 qr{ (" [^"]* [^[:space:]] ") (?![^[:space]]) }x, 44 qr{ (" [^"]* [^[:space:]] ") (?![^[:space:]]) }x,
42 qr{ \< ([^<>[:space:]]+) \> }x, 45 qr{ \< ([^<>[:space:]]+) \> }x,
43 qr{ \{ ([^{}[:space:]]+) \} }x, 46 qr{ \{ ([^{}[:space:]]+) \} }x,
44 qr{ \[ ([^{}[:space:]]+) \] }x, 47 qr{ \[ ([^{}[:space:]]+) \] }x,
45 qr{ \( ([^()[:space:]]+) \) }x, 48 qr{ \( ([^()[:space:]]+) \) }x,
46 49
47 # urls, just a heuristic 50 # urls, just a heuristic
48 qr{( 51 qr{(
49 (?:https?://|ftp://|news://|mailto:|file://)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~]+ 52 (?:https?://|ftp://|news://|mailto:|file://|\bwww\.)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~#]+
50 [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27()~] # exclude some trailing characters (heuristic) 53 [ab-zA-Z0-9\-\@;\/?:&=%\$_+*()~] # exclude some trailing characters (heuristic)
51 )}x, 54 )}x,
52 55
53 # shell-like argument quoting, basically always matches 56 # shell-like argument quoting, basically always matches
54 qr{\G [\ \t|&;<>()]* ( 57 qr{\G [\ \t|&;<>()]* (
55 (?: 58 (?:
81 - $line->offset_of ($self->selection_beg); 84 - $line->offset_of ($self->selection_beg);
82 85
83 my @matches; 86 my @matches;
84 87
85 if ($markofs < $line->l) { 88 if ($markofs < $line->l) {
86 # convert markofs form character to UTF-8 offset space 89 # convert markofs from character to UTF-8 offset space
87 { 90 {
88 my $prefix = substr $text, 0, $markofs; 91 my $prefix = substr $text, 0, $markofs;
89 utf8::encode $prefix; 92 utf8::encode $prefix;
90 $markofs = length $prefix; 93 $markofs = length $prefix;
91 } 94 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines