aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPTextViewAdditions.m7
1 files 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();
}
/*