*** empty log message ***
authorroot <root>
Thu, 12 Jan 2006 23:30:51 +0000 (23:30 +0000)
committerroot <root>
Thu, 12 Jan 2006 23:30:51 +0000 (23:30 +0000)
src/perl/selection

index 927a11c..d5fdd8b 100644 (file)
@@ -23,11 +23,14 @@ sub on_init {
 # "find interetsing things"-patterns
 my @mark_patterns = (
    # common types of "parentheses"
-   qr{(?:^|\s) ‘  ([^‘’]+?) ’ (?:\s|\)|$)}x,
-   qr{(?:^|\s) `  ([^`']+?) ' (?:\s|\)|$)}x,
-   qr{         \{ ([^{}]+?) \} }x,
-   qr{         \[ ([^{}]+?) \] }x,
-   qr{         \( ([^()]+?) \) }x,
+   qr{ (?<![^[:space:]]) ‘ ([^‘’]+) ’ (?![^[:space]]) }x,
+   qr{ (?<![^[:space:]]) ` ([^`']+) ' (?![^[:space]]) }x,
+   qr{ (?<![^[:space:]]) (" [^[:space:]] [^"]* ")                 }x,
+   qr{                   (" [^"]* [^[:space:]] ") (?![^[:space]]) }x,
+   qr{ \< ([^<>[:space:]]+) \> }x,
+   qr{ \{ ([^{}[:space:]]+) \} }x,
+   qr{ \[ ([^{}[:space:]]+) \] }x,
+   qr{ \( ([^()[:space:]]+) \) }x,
 
    # urls, just a heuristic
    qr{(
@@ -70,8 +73,6 @@ sub on_sel_extend {
             my $ofs = $-[1];
             my $match = $1;
 
-            push @matches, [$ofs, length $match];
-
             for my $regex (@simplify_patterns) {
                if ($match =~ $regex) {
                   $match = $1;