From 4225c12ba967f91efb136adc63a4400422b01708 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 25 Oct 2010 10:00:40 +0000 Subject: =?UTF-8?q?=E2=80=A2=20improved=20"Select=20Line"=20-=20it=20selec?= =?UTF-8?q?ts=20the=20entire=20current=20line=20even=20if=20it's=20wrapped?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTextViewAdditions.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 93eccf5b..cab4382c 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -88,8 +88,11 @@ */ - (IBAction)selectCurrentLine:(id)sender { - [self doCommandBySelector:@selector(moveToBeginningOfLine:)]; - [self doCommandBySelector:@selector(moveToEndOfLineAndModifySelection:)]; + NSRange lineRange = [[self string] lineRangeForRange:[self selectedRange]]; + if(lineRange.location != NSNotFound && lineRange.length) + [self setSelectedRange:lineRange]; + else + NSBeep(); } /* -- cgit v1.2.3