Skip to content

Commit

Permalink
Merge branch 'release/3.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
1024jp committed Jun 13, 2020
2 parents a818d77 + b3af008 commit dcb4593
Show file tree
Hide file tree
Showing 23 changed files with 276 additions and 117 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
Change Log
==========================

3.9.1 (423)
--------------------------

### Improvements

- Increase the size of the invisible space symbol.
- Adjust the position of invisible symbols in vertical text orientation.
- [trivial] Avoid selecting no item in the snippet setting table.


### Fixes

- Fix an issue in the syntax style editing that saving existing syntax styles failed.
- Fix text flickering while pinch-zoom.
- Fix an issue in the editor where the bottom part of the editor became occasionally not responsive when the editor is zoomed-out.
- Fix an issue in the find panel fields that carriage returns (CR) were not drawn as line endings but control characters.
- Fix an issue in the syntax style editing that reverting a modified bundled style through the style editor did not remove the existing user file.
- Fix an issue under macOS 10.14 that the text in the About panel was black even in the Dark Mode.



3.9.0 (421)
--------------------------

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,40 @@ <h1>Release Notes</h1>



<article>
<header>
<h1>CotEditor 3.9.1</h1>
<p>release: <time>2020-06-14</time></p>
</header>


<section>
<h2>Improvements</h2>

<ul>
<li>Increase the size of the invisible space symbol.</li>
<li>Adjust the position of invisible symbols in vertical text orientation.</li>
<li><span class="trivial">trivial</span>: Avoid selecting no item in the snippet setting table.</li>
</ul>
</section>


<section>
<h2>Fixes</h2>

<ul>
<li>Fix an issue in the syntax style editing that saving existing syntax styles failed.</li>
<li>Fix text flickering while pinch-zoom.</li>
<li>Fix an issue in the editor where the bottom part of the editor became occasionally not responsive when the editor is zoomed-out.</li>
<li>Fix an issue in the find panel fields that carriage returns (CR) were not drawn as line endings but control characters.</li>
<li>Fix an issue in the syntax style editing that reverting a modified bundled style through the style editor did not remove the existing user file.</li>
<li>Fix an issue under macOS 10.14 that the text in the About panel was black even in the Dark Mode.</li>
</ul>
</section>
</article>



<article>
<header>
<h1>CotEditor 3.9.0</h1>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,40 @@ <h1>リリースノート</h1>



<article>
<header>
<h1>CotEditor 3.9.1</h1>
<p>リリース: <time>2020-06-14</time></p>
</header>


<section>
<h2>改良</h2>

<ul>
<li>スペース記号のサイズを調整し若干大きく</li>
<li>縦書きのときの不可視文字の描画位置を調整</li>
<li><span class="trivial">trivial</span>: スニペットキーバインドの設定のリストのデフォルトが無選択ではなく最初の項目を選択している状態に</li>
</ul>
</section>


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

<ul>
<li>既存のシンタックススタイルを編集して保存しようとすると保存に失敗する不具合を修正</li>
<li>ピンチズーム時の文字のチラツキを修正</li>
<li>テキストを縮小したときにエディタの下側がスクロールやピンチズームに反応しなくなることがあった不具合を修正</li>
<li>検索パネルの入力欄で改行コードCR (carriage return)が改行記号でなくコントロール記号で表示されていた不具合を修正</li>
<li>バンドルされているシンタックススタイルを改変していたときに、それをデフォルトに戻しても設定ファイルが削除されなかった不具合を修正</li>
<li>macOS 10.14でダークモードのときに「CotEditorについて」の文字が黒かった不具合を修正</li>
</ul>
</section>
</article>



<article>
<header>
<h1>CotEditor 3.9.0</h1>
Expand Down
16 changes: 8 additions & 8 deletions CotEditor/CotEditor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4142,10 +4142,10 @@
baseConfigurationReference = 5454B92E243C8257009275BC /* CotEditor.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 421;
CURRENT_PROJECT_VERSION = 423;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Info.plist;
MARKETING_VERSION = 3.9.0;
MARKETING_VERSION = 3.9.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.coteditor.$(PRODUCT_NAME)";
PRODUCT_NAME = CotEditor;
};
Expand All @@ -4156,10 +4156,10 @@
baseConfigurationReference = 5454B92E243C8257009275BC /* CotEditor.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 421;
CURRENT_PROJECT_VERSION = 423;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Info.plist;
MARKETING_VERSION = 3.9.0;
MARKETING_VERSION = 3.9.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.coteditor.$(PRODUCT_NAME)";
PRODUCT_NAME = CotEditor;
};
Expand Down Expand Up @@ -4218,14 +4218,14 @@
baseConfigurationReference = 5454B92D243C8257009275BC /* CotEditor-Sparkle.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 421;
CURRENT_PROJECT_VERSION = 423;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/../Frameworks/Build",
);
INFOPLIST_FILE = "Info-Sparkle.plist";
MARKETING_VERSION = 3.9.0;
MARKETING_VERSION = 3.9.1;
OTHER_SWIFT_FLAGS = "$(inherited) -D SPARKLE";
PRODUCT_BUNDLE_IDENTIFIER = com.coteditor.CotEditor;
PRODUCT_NAME = CotEditor;
Expand All @@ -4237,14 +4237,14 @@
baseConfigurationReference = 5454B92D243C8257009275BC /* CotEditor-Sparkle.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 421;
CURRENT_PROJECT_VERSION = 423;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/../Frameworks/Build",
);
INFOPLIST_FILE = "Info-Sparkle.plist";
MARKETING_VERSION = 3.9.0;
MARKETING_VERSION = 3.9.1;
OTHER_SWIFT_FLAGS = "$(inherited) -D SPARKLE";
PRODUCT_BUNDLE_IDENTIFIER = com.coteditor.CotEditor;
PRODUCT_NAME = CotEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -50,6 +52,22 @@
ReferencedContainer = "container:CotEditor.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2A6F0D4E1B5500E100C2D03C"
BuildableName = "CotEditor.app"
BlueprintName = "CotEditor"
ReferencedContainer = "container:CotEditor.xcodeproj">
</BuildableReference>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SyntaxMapBuilder"
BuildableName = "SyntaxMapBuilder"
BlueprintName = "SyntaxMapBuilder"
ReferencedContainer = "container:../SyntaxMapBuilder">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
6 changes: 6 additions & 0 deletions CotEditor/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
#endif

// backward compatibility for macOS 10.14 that does not support `-apple-system*` colors (macOS 10.15)
if NSAppKitVersion.current < .macOS10_15, #available(macOS 10.14, *), NSApp.effectiveAppearance.isDark {
html = html.replacingOccurrences(of: "<body>", with: "<body style=\"color: hsla(0,0%,100%,.85)\">")
html = html.replacingOccurrences(of: "<h2>", with: "<h2 style=\"color: hsla(0,0%,100%,.55)\">")
}

let attrString = NSAttributedString(html: html.data(using: .utf8)!, baseURL: creditsURL, documentAttributes: nil)!
NSApplication.shared.orderFrontStandardAboutPanel(options: [.credits: attrString])
}
Expand Down
7 changes: 4 additions & 3 deletions CotEditor/Sources/Console.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ final class ConsoleViewController: NSViewController {
return paragraphStyle
}()

private let dateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
private let dateFormatter: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.timeZone = .current
formatter.formatOptions = [.withFullDate, .withTime, .withDashSeparatorInDate, .withSpaceBetweenDateAndTime, .withColonSeparatorInTime]
return formatter
}()

Expand Down
21 changes: 9 additions & 12 deletions CotEditor/Sources/DocumentWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ final class DocumentWindow: NSWindow {
// MARK: -
// MARK: Lifecycle

override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing bufferingType: NSWindow.BackingStoreType, defer flag: Bool) {

super.init(contentRect: contentRect, styleMask: style, backing: bufferingType, defer: flag)

self.appearanceObserver = self.observe(\.effectiveAppearance) { [weak self] (_, _) in
guard let self = self, !self.isOpaque else { return }

self.invalidateTitlebarOpacity()
}
}


deinit {
self.appearanceObserver?.invalidate()
}
Expand All @@ -105,6 +93,15 @@ final class DocumentWindow: NSWindow {

self.invalidateTitlebarOpacity()

if isOpaque {
self.appearanceObserver?.invalidate()
self.appearanceObserver = nil
} else if self.appearanceObserver == nil {
self.appearanceObserver = self.observe(\.effectiveAppearance) { [weak self] (_, _) in
self?.invalidateTitlebarOpacity()
}
}

NotificationCenter.default.post(name: DocumentWindow.didChangeOpacityNotification, object: self)
}
}
Expand Down
6 changes: 2 additions & 4 deletions CotEditor/Sources/EditorTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1494,10 +1494,7 @@ final class EditorTextView: NSTextView, Themable, CurrentLineHighlighting, URLDe
/// calculate overscrolling amount
private func invalidateOverscrollRate() {

guard
let layoutManager = self.layoutManager as? LayoutManager,
let textContainer = self.textContainer
else { return }
guard let layoutManager = self.layoutManager as? LayoutManager else { return }

let visibleRect = self.visibleRect
let rate = UserDefaults.standard[.overscrollRate].clamped(to: 0...1.0)
Expand All @@ -1516,6 +1513,7 @@ final class EditorTextView: NSTextView, Themable, CurrentLineHighlighting, URLDe
// invoke `setToFit()` but only when needed to avoid heavy calculation by large document
// -> `setToFit()` is required to remove the extra height of the frame that contains a blank margin already
// due to the smaller text content than the visible rect (macOS 10.15).
guard let textContainer = self.textContainer else { return assertionFailure() }
let maxVisibleYGlyphIndex = layoutManager.glyphIndex(for: NSPoint(x: 0, y: visibleRect.height), in: textContainer)
let maxVisibleY = layoutManager.isValidGlyphIndex(maxVisibleYGlyphIndex)
? layoutManager.lineFragmentRect(forGlyphAt: maxVisibleYGlyphIndex, effectiveRange: nil, withoutAdditionalLayout: true).maxY
Expand Down
3 changes: 2 additions & 1 deletion CotEditor/Sources/Invisible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ enum Invisible {
// cf. https://developer.apple.com/documentation/appkit/nscontrolglyph

switch codeUnit {
case 0x000A: // LINE FEED (Cc) a.k.a. \n
case 0x000A, // LINE FEED (Cc) a.k.a. \n
0x000D: // CARRIAGE RETURN (Cc)
self = .newLine
case 0x0009: // HORIZONTAL TABULATION (Cc) a.k.a. \t
self = .tab
Expand Down
12 changes: 11 additions & 1 deletion CotEditor/Sources/KeyBindingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class KeyBindingsViewController: NSViewController, NSOutlineViewDataSource, NSOu
@objc private dynamic var warningMessage: String? // for binding
@objc private dynamic var isRestoreble: Bool = false // for binding

@IBOutlet private weak var outlineView: NSOutlineView?
@IBOutlet fileprivate weak var outlineView: NSOutlineView?



Expand Down Expand Up @@ -291,6 +291,16 @@ final class SnippetKeyBindingsViewController: KeyBindingsViewController, NSTextV
}


override func viewWillAppear() {

super.viewWillAppear()

if let outlineView = self.outlineView, outlineView.selectedRow == -1 {
outlineView.selectRowIndexes([0], byExtendingSelection: false)
}
}



// MARK: Key Bindings View Controller Methods

Expand Down
4 changes: 1 addition & 3 deletions CotEditor/Sources/LineEnding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ enum LineEnding: Character {

private extension LineEnding {

static let characterSet = CharacterSet(charactersIn: "\n\r\u{2028}\u{2029}")
static let regexPattern = "\\r\\n|[\\n\\r\\u2028\\u2029]"
}

Expand All @@ -99,8 +98,7 @@ extension StringProtocol where Self.Index == String.Index {
/// The first line ending type.
var detectedLineEnding: LineEnding? {

// -> We don't use `CharacterSet.newlines` because it contains more characters than we need.
guard let range = self.rangeOfCharacter(from: LineEnding.characterSet) else { return nil }
guard let range = self.range(of: LineEnding.regexPattern, options: .regularExpression) else { return nil }

// -> Swift treats "\r\n" also as a single character.
let character = self[range.lowerBound]
Expand Down
Loading

0 comments on commit dcb4593

Please sign in to comment.