adium/adium

Parents 3379283a9336
Children e5f5b3eeb541
Patch from Detmud: fix "add link" when the cursor is at the end of the line. Fixes #16200.
--- a/ChangeLogs/Changes.txt Wed Feb 13 17:30:26 2013 +0100
+++ b/ChangeLogs/Changes.txt Wed Feb 13 19:04:57 2013 +0100
@@ -1,6 +1,7 @@
Adium Version History
-----------------------
Version 1.5.5 (X/X/X)
+ * Fixed "Add Link..." when the cursor is at the end of the line. (#16200)
* Updated Spanish translation. (#16291)
--- a/Plugins/Link Management/SHLinkEditorWindowController.m Wed Feb 13 17:30:26 2013 +0100
+++ b/Plugins/Link Management/SHLinkEditorWindowController.m Wed Feb 13 19:04:57 2013 +0100
@@ -90,8 +90,8 @@
NSString *linkText;
id linkURL = nil;
- // Get the selected link (We have to be careful when the selection is at the very end of our text view)
- if ([[textView textStorage] length] > 0 && selectedRange.location != NSNotFound && NSMaxRange(selectedRange) <= [[textView textStorage] length]) {
+ // Text is selected if the selected Range is Greater than 0 !
+ if (selectedRange.length > 0) {
linkURL = [[textView textStorage] attribute:NSLinkAttributeName
atIndex:selectedRange.location
effectiveRange:&rangeOfLinkAttribute];