Revision: 3047
http://skim-app.svn.sourceforge.net/skim-app/?rev=3047&view=rev
Author: hofman
Date: 2007-10-17 05:34:29 -0700 (Wed, 17 Oct 2007)
Log Message:
-----------
Fix last commit. Trailing empty line should not include the newline.
Modified Paths:
--------------
trunk/NSString_SKExtensions.m
Modified: trunk/NSString_SKExtensions.m
===================================================================
--- trunk/NSString_SKExtensions.m 2007-10-17 12:12:09 UTC (rev 3046)
+++ trunk/NSString_SKExtensions.m 2007-10-17 12:34:29 UTC (rev 3047)
@@ -228,7 +228,7 @@
#pragma mark Empty lines
-// whitespace at the beginning of the string up to the end or until (and
including) a newline
+// whitespace at the beginning of the string up to and including a newline
- (NSRange)rangeOfLeadingEmptyLine {
return [self rangeOfLeadingEmptyLine:NULL];
}
@@ -263,7 +263,7 @@
return wsRange;
}
-// whitespace at the end of the string from the beginning or after a newline
+// whitespace at the end of the string after a newline
- (NSRange)rangeOfTrailingEmptyLine {
return [self rangeOfTrailingEmptyLine:NULL];
}
@@ -285,12 +285,8 @@
} else {
unichar lastChar = [self characterAtIndex:lastCharRange.location];
unsigned int rangeEnd = NSMaxRange(lastCharRange);
- if (rangeEnd < end && [[NSCharacterSet newlineCharacterSet]
characterIsMember:lastChar]) {
- if (lastChar == '\n' && rangeEnd - 1 > range.location && [self
characterAtIndex:rangeEnd - 2] == '\r')
- wsRange = NSMakeRange(rangeEnd - 1, end - rangeEnd + 1);
- else
- wsRange = NSMakeRange(rangeEnd, end - rangeEnd);
- }
+ if ([[NSCharacterSet newlineCharacterSet] characterIsMember:lastChar])
+ wsRange = NSMakeRange(rangeEnd, end - rangeEnd);
if (onlyWhite)
*onlyWhite = NO;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit