From 54ae046c2a5ac13eeb76d54d1d4867bb11caf80e Mon Sep 17 00:00:00 2001 From: Bert Date: Thu, 14 Apr 2011 11:03:04 +0200 Subject: [PATCH] keyboard-select: fixed offset init on blank line --- keyboard-select | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard-select b/keyboard-select index f74814d..178e636 100644 --- a/keyboard-select +++ b/keyboard-select @@ -1,7 +1,7 @@ #! perl -w # Author: Bert Muennich # Website: http://www.github.com/muennich/urxvt-perls -# Version: 1.5 +# Version: git-20110414 # License: GPLv2 # Use keyboard shortcuts to select and copy text. @@ -438,7 +438,7 @@ sub activate { ); if ($self->{offset} >= $line->l) { - $self->{offset} = $line->l - 1; + $self->{offset} = $line->l > 0 ? $line->l - 1 : 0; $self->screen_cur($line->coord_of($self->{offset})); $self->want_refresh(); }