Skip to content

Commit

Permalink
Merge branch 'release/2.5.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
usami-k committed May 13, 2016
2 parents 85c5819 + 17cc539 commit 4f13742
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 29 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--------------------------

Expand Down
4 changes: 2 additions & 2 deletions CotEditor/CotEditor -AppStore-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.5.3</string>
<string>2.5.4</string>
<key>CFBundleSignature</key>
<string>cEd1</string>
<key>CFBundleVersion</key>
<string>125</string>
<string>127</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions CotEditor/CotEditor-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.5.3</string>
<string>2.5.4</string>
<key>CFBundleSignature</key>
<string>cEd1</string>
<key>CFBundleVersion</key>
<string>125</string>
<string>127</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,25 @@ <h1>Release Notes</h1>
<article>
<header>
<h1>CotEditor 2.5.3</h1>
<p>release: <time>2016-05</time></p>
<p>release: <time>2016-05-13</time></p>
</header>


<section>
<h2>Fixes</h2>

<ul>
<li>Fix an issue where application didn't work on Mavericks and earlier.</li>
<li>Fix an issue where syntax was occasionally parsed wtice on window restoration.</li>
</ul>
</section>
</article>


<article>
<header>
<h1>CotEditor 2.5.3</h1>
<p>release: <time>2016-05-12</time></p>
</header>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,28 @@
<h1>リリースノート</h1>


<article>
<header>
<h1>CotEditor 2.5.4</h1>
<p>リリース: <time>2016-05-13</time></p>
</header>


<section>
<h2>修正</h2>

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


<article>
<header>
<h1>CotEditor 2.5.3</h1>
<p>リリース: <time>2016-05</time></p>
<p>リリース: <time>2016-05-12</time></p>
</header>


Expand Down
4 changes: 4 additions & 0 deletions CotEditor/Sources/CEBorderView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
10 changes: 5 additions & 5 deletions CotEditor/Sources/CESyntaxHighlightParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ - (nullable instancetype)init
/// initialize instance
- (nonnull instancetype)initWithString:(nonnull NSString *)string
dictionary:(nonnull NSDictionary *)dictionary
simpleWordsCharacterSets:(nullable NSDictionary<NSString *,NSCharacterSet *> *)simpleWordsCharacterSets
pairedQuoteTypes:(nullable NSDictionary<NSString *,NSString *> *)pairedQuoteTypes
simpleWordsCharacterSets:(nullable NSDictionary<NSString *, NSCharacterSet *> *)simpleWordsCharacterSets
pairedQuoteTypes:(nullable NSDictionary<NSString *, NSString *> *)pairedQuoteTypes
inlineCommentDelimiter:(nullable NSString *)inlineCommentDelimiter
blockCommentDelimiters:(nullable NSDictionary<NSString *,NSString *> *)blockCommentDelimiters
blockCommentDelimiters:(nullable NSDictionary<NSString *, NSString *> *)blockCommentDelimiters
// ------------------------------------------------------
{
self = [super init];
Expand All @@ -133,15 +133,15 @@ - (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<NSString *,NSArray<NSValue *> *> * _Nonnull))completionHandler
- (void)parseRange:(NSRange)range completionHandler:(void (^)(NSDictionary<NSString *, NSArray<NSValue *> *> * _Nonnull))completionHandler
// ------------------------------------------------------
{
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
typeof(self) self = weakSelf; // strong self
if (!self) { return; }

NSDictionary<NSString *,NSArray<NSValue *> *> *highlights = [self extractAllHighlightsFromString:[self string] range:range];
NSDictionary<NSString *, NSArray<NSValue *> *> *highlights = [self extractAllHighlightsFromString:[self string] range:range];
if (completionHandler) {
dispatch_sync(dispatch_get_main_queue(), ^{
completionHandler(highlights);
Expand Down
28 changes: 13 additions & 15 deletions CotEditor/Sources/CESyntaxOutlineParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,19 @@ - (void)parseWithCompletionHandler:(nullable void (^)(NSArray<NSDictionary<NSStr
}];
}

if ([outlineItems count] > 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(), ^{
Expand Down
10 changes: 7 additions & 3 deletions CotEditor/Sources/CESyntaxStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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<NSDictionary<NSString *,id> *> * _Nonnull))completionHandler
// ------------------------------------------------------
{
Expand Down
4 changes: 4 additions & 0 deletions CotEditor/Sources/CETheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ - (nonnull NSColor *)selectionColor
- (nonnull NSColor *)weakTextColor
//------------------------------------------------------
{
if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) {
return _weakTextColor;
}

if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast]) {
return [self textColor];
}
Expand Down

0 comments on commit 4f13742

Please sign in to comment.