*** empty log message ***
authorroot <root>
Tue, 3 Jan 2006 21:08:39 +0000 (21:08 +0000)
committerroot <root>
Tue, 3 Jan 2006 21:08:39 +0000 (21:08 +0000)
src/perl/selection
src/urxvt.pm

index f05cd99..4395e44 100644 (file)
@@ -12,6 +12,16 @@ sub on_keyboard_command {
 my @patterns = (
    # urls
    qr{ ([a-z0-9.+\-]+://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),]+) }x,
+
+   # shell-like argument quoting
+   qr{\G\s*(
+      (?:
+         [^"'\\ \t]+
+         | \\.
+         | " ([^\\"]+ | \\. )* "
+         | ' [^']* '
+      )+
+   )}xs,
 );
 
 sub on_sel_extend {
@@ -24,9 +34,9 @@ sub on_sel_extend {
 
    for my $regex (@patterns) {
       while ($text =~ /$regex/g) {
-         if ($-[0] <= $offset and $offset <= $+[0]) {
-            $self->selection_beg ($line->coord_of ($-[0]));
-            $self->selection_end ($line->coord_of ($+[0]));
+         if ($-[1] <= $offset and $offset <= $+[1]) {
+            $self->selection_beg ($line->coord_of ($-[1]));
+            $self->selection_end ($line->coord_of ($+[1]));
             return 1;
          }
       }
index 167c63e..564b35a 100644 (file)
@@ -386,6 +386,8 @@ sub invoke {
    verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")"
       if $verbosity >= 10;
 
+   keys %$cb;
+
    while (my ($pkg, $cb) = each %$cb) {
       return 1
          if $cb->(