diff --git a/CHANGELOG.md b/CHANGELOG.md index 32be543b9c..4d019973ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ Change Log ========================== +2.5.4 (127) +-------------------------- + +### Fixes + +- Fix an issue where application didn't work on Mavericks and earlier. +- Fix an issue where syntax was occasionally parsed wtice on window restoration. + + + 2.5.3 (125) -------------------------- diff --git a/CotEditor/CotEditor -AppStore-Info.plist b/CotEditor/CotEditor -AppStore-Info.plist index 10146e2cd8..6f40042bf9 100644 --- a/CotEditor/CotEditor -AppStore-Info.plist +++ b/CotEditor/CotEditor -AppStore-Info.plist @@ -969,11 +969,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.5.3 + 2.5.4 CFBundleSignature cEd1 CFBundleVersion - 125 + 127 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/CotEditor/CotEditor-Info.plist b/CotEditor/CotEditor-Info.plist index 6433ab402e..564a7dfba8 100644 --- a/CotEditor/CotEditor-Info.plist +++ b/CotEditor/CotEditor-Info.plist @@ -969,11 +969,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.5.3 + 2.5.4 CFBundleSignature cEd1 CFBundleVersion - 125 + 127 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/CotEditor/CotEditor.help/Contents/Resources/en.lproj/pgs/releasenotes.html b/CotEditor/CotEditor.help/Contents/Resources/en.lproj/pgs/releasenotes.html index 932dd00f3b..361878bb3b 100644 --- a/CotEditor/CotEditor.help/Contents/Resources/en.lproj/pgs/releasenotes.html +++ b/CotEditor/CotEditor.help/Contents/Resources/en.lproj/pgs/releasenotes.html @@ -25,7 +25,25 @@

Release Notes

CotEditor 2.5.3

-

release:

+

release:

+
+ + +
+

Fixes

+ + +
+
+ + +
+
+

CotEditor 2.5.3

+

release:

diff --git a/CotEditor/CotEditor.help/Contents/Resources/ja.lproj/pgs/releasenotes.html b/CotEditor/CotEditor.help/Contents/Resources/ja.lproj/pgs/releasenotes.html index 3922464d60..8df6ebfda5 100644 --- a/CotEditor/CotEditor.help/Contents/Resources/ja.lproj/pgs/releasenotes.html +++ b/CotEditor/CotEditor.help/Contents/Resources/ja.lproj/pgs/releasenotes.html @@ -22,10 +22,28 @@

リリースノート

+
+
+

CotEditor 2.5.4

+

リリース:

+
+ + +
+

修正

+ +
    +
  • Mavericks 以前でアプリケーションが機能しない不具合を修正
  • +
  • ウインドウ復帰時に稀にシンタックスが2度解析されることがあった不具合を修正
  • +
+
+
+ +

CotEditor 2.5.3

-

リリース:

+

リリース:

diff --git a/CotEditor/Sources/CEBorderView.m b/CotEditor/Sources/CEBorderView.m index 3fe8156bec..bf80dd70b1 100644 --- a/CotEditor/Sources/CEBorderView.m +++ b/CotEditor/Sources/CEBorderView.m @@ -94,6 +94,10 @@ - (void)drawLayer:(nonnull CALayer *)layer inContext:(nonnull CGContextRef)ctx - (nonnull NSColor *)borderColor // ------------------------------------------------------ { + if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) { + return [NSColor windowFrameColor]; + } + BOOL increasesContrast = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast]; return increasesContrast ? [NSColor gridColor] : [NSColor windowFrameColor]; diff --git a/CotEditor/Sources/CESyntaxHighlightParser.m b/CotEditor/Sources/CESyntaxHighlightParser.m index 67615008f4..5c020a42c7 100644 --- a/CotEditor/Sources/CESyntaxHighlightParser.m +++ b/CotEditor/Sources/CESyntaxHighlightParser.m @@ -109,10 +109,10 @@ - (nullable instancetype)init /// initialize instance - (nonnull instancetype)initWithString:(nonnull NSString *)string dictionary:(nonnull NSDictionary *)dictionary - simpleWordsCharacterSets:(nullable NSDictionary *)simpleWordsCharacterSets - pairedQuoteTypes:(nullable NSDictionary *)pairedQuoteTypes + simpleWordsCharacterSets:(nullable NSDictionary *)simpleWordsCharacterSets + pairedQuoteTypes:(nullable NSDictionary *)pairedQuoteTypes inlineCommentDelimiter:(nullable NSString *)inlineCommentDelimiter - blockCommentDelimiters:(nullable NSDictionary *)blockCommentDelimiters + blockCommentDelimiters:(nullable NSDictionary *)blockCommentDelimiters // ------------------------------------------------------ { self = [super init]; @@ -133,7 +133,7 @@ - (nonnull instancetype)initWithString:(nonnull NSString *)string // ------------------------------------------------------ /// parse string in background and return extracted highlight ranges per syntax types -- (void)parseRange:(NSRange)range completionHandler:(void (^)(NSDictionary *> * _Nonnull))completionHandler +- (void)parseRange:(NSRange)range completionHandler:(void (^)(NSDictionary *> * _Nonnull))completionHandler // ------------------------------------------------------ { __weak typeof(self) weakSelf = self; @@ -141,7 +141,7 @@ - (void)parseRange:(NSRange)range completionHandler:(void (^)(NSDictionary *> *highlights = [self extractAllHighlightsFromString:[self string] range:range]; + NSDictionary *> *highlights = [self extractAllHighlightsFromString:[self string] range:range]; if (completionHandler) { dispatch_sync(dispatch_get_main_queue(), ^{ completionHandler(highlights); diff --git a/CotEditor/Sources/CESyntaxOutlineParser.m b/CotEditor/Sources/CESyntaxOutlineParser.m index 5ae460b028..441e7fb59d 100644 --- a/CotEditor/Sources/CESyntaxOutlineParser.m +++ b/CotEditor/Sources/CESyntaxOutlineParser.m @@ -182,21 +182,19 @@ - (void)parseWithCompletionHandler:(nullable void (^)(NSArray 0) { - // sort by location - [outlineItems sortUsingComparator:^NSComparisonResult(id obj1, id obj2) { - NSRange range1 = [obj1[CEOutlineItemRangeKey] rangeValue]; - NSRange range2 = [obj2[CEOutlineItemRangeKey] rangeValue]; - - if (range1.location > range2.location) { - return NSOrderedDescending; - } else if (range1.location < range2.location) { - return NSOrderedAscending; - } else { - return NSOrderedSame; - } - }]; - } + // sort by location + [outlineItems sortUsingComparator:^NSComparisonResult(id obj1, id obj2) { + NSRange range1 = [obj1[CEOutlineItemRangeKey] rangeValue]; + NSRange range2 = [obj2[CEOutlineItemRangeKey] rangeValue]; + + if (range1.location > range2.location) { + return NSOrderedDescending; + } else if (range1.location < range2.location) { + return NSOrderedAscending; + } else { + return NSOrderedSame; + } + }]; if (completionHandler) { dispatch_sync(dispatch_get_main_queue(), ^{ diff --git a/CotEditor/Sources/CESyntaxStyle.m b/CotEditor/Sources/CESyntaxStyle.m index 8299ef375a..121e01b8fc 100644 --- a/CotEditor/Sources/CESyntaxStyle.m +++ b/CotEditor/Sources/CESyntaxStyle.m @@ -251,8 +251,10 @@ - (BOOL)isEqualToSyntaxStyle:(CESyntaxStyle *)syntaxStyle { if ([[syntaxStyle styleName] isEqualToString:[self styleName]] && [[syntaxStyle highlightDictionary] isEqualToDictionary:[self highlightDictionary]] && - [[syntaxStyle inlineCommentDelimiter] isEqualToString:[self inlineCommentDelimiter]] && - [[syntaxStyle blockCommentDelimiters] isEqualToDictionary:[self blockCommentDelimiters]]) + ((![syntaxStyle inlineCommentDelimiter] && ![self inlineCommentDelimiter]) || + [[syntaxStyle inlineCommentDelimiter] isEqualToString:[self inlineCommentDelimiter]]) && + ((![syntaxStyle blockCommentDelimiters] && ![self blockCommentDelimiters]) || + [[syntaxStyle blockCommentDelimiters] isEqualToDictionary:[self blockCommentDelimiters]])) { return YES; } @@ -269,8 +271,10 @@ - (BOOL)isEqualToSyntaxStyle:(CESyntaxStyle *)syntaxStyle @implementation CESyntaxStyle (Outline) +#pragma mark Public Methods + // ------------------------------------------------------ -/// +/// parse outline - (void)parseOutlineItemsInString:(nonnull NSString *)string completionHandler:(nullable void (^)(NSArray *> * _Nonnull))completionHandler // ------------------------------------------------------ { diff --git a/CotEditor/Sources/CETheme.m b/CotEditor/Sources/CETheme.m index ab893ae975..0ee801ab90 100644 --- a/CotEditor/Sources/CETheme.m +++ b/CotEditor/Sources/CETheme.m @@ -208,6 +208,10 @@ - (nonnull NSColor *)selectionColor - (nonnull NSColor *)weakTextColor //------------------------------------------------------ { + if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) { + return _weakTextColor; + } + if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast]) { return [self textColor]; }