From 27b3a85fa8a82260b6f010a5afae28a0a5f69c4e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Jan 2006 21:08:39 +0000 Subject: [PATCH] *** empty log message *** --- src/perl/selection | 16 +++++++++++++--- src/urxvt.pm | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/perl/selection b/src/perl/selection index f05cd99b..4395e443 100644 --- a/src/perl/selection +++ b/src/perl/selection @@ -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; } } diff --git a/src/urxvt.pm b/src/urxvt.pm index 167c63e8..564b35a0 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -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->( -- 2.34.1