From 21ed78a65033bd2853f98e4a3af456461bfb01ec Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 2 Apr 2012 11:20:44 +0200 Subject: [PATCH] url-select: new selection method see: https://github.com/muennich/urxvt-perls/issues/18 --- url-select | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/url-select b/url-select index fe3aa1a..38d7b67 100755 --- a/url-select +++ b/url-select @@ -185,8 +185,12 @@ sub select_next { $self->{n} += $dir; hilight($self); if ($self->{copy}) { - $self->selection($self->{found}->[$self->{n}]->[4]); - $self->selection_grab($event->{time}); + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); } return; } @@ -212,13 +216,17 @@ sub select_next { $self->{n} = $dir < 0 ? $#{$self->{found}} : 0; hilight($self); if ($self->{copy}) { - $self->selection($self->{found}->[$self->{n}]->[4]); - $self->selection_grab($event->{time}); + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); } return; } } - + deactivate($self) unless $self->{found}; () @@ -334,4 +342,3 @@ sub deactivate { () } -