Skip to content

Commit

Permalink
Merge branch 'release/4.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
1024jp committed Aug 13, 2022
2 parents 91ac84b + 197099c commit d14ecd0
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 55 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,6 +2,18 @@
Change Log
==========================

4.3.3 (525)
--------------------------

### Fixes

- Fix an issue that the application could hang up when an opened document shared in iCloud Drive was modified in another machine.
- Fix an issue that document windows sometimes did not shift the initial position from the last window.
- Fix an issue that the scrollable area of the editor in vertical layout orientation could be clipped wrongly when scaled.
- Fix an issue that some text was not localized.



4.3.2 (522)
--------------------------

Expand Down Expand Up @@ -39,7 +51,7 @@ Change Log

### Fixes

- Fix an issue that memory rarely leaks on closing documents.
- Fix an issue that memory rarely leaked on closing documents.



Expand Down
16 changes: 8 additions & 8 deletions CotEditor.xcodeproj/project.pbxproj
Expand Up @@ -4443,10 +4443,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CURRENT_PROJECT_VERSION = 522;
CURRENT_PROJECT_VERSION = 525;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = CotEditor/Info.plist;
MARKETING_VERSION = 4.3.2;
MARKETING_VERSION = 4.3.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.coteditor.$(PRODUCT_NAME)";
PRODUCT_NAME = CotEditor;
};
Expand All @@ -4458,10 +4458,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CURRENT_PROJECT_VERSION = 522;
CURRENT_PROJECT_VERSION = 525;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = CotEditor/Info.plist;
MARKETING_VERSION = 4.3.2;
MARKETING_VERSION = 4.3.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.coteditor.$(PRODUCT_NAME)";
PRODUCT_NAME = CotEditor;
};
Expand Down Expand Up @@ -4497,10 +4497,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CURRENT_PROJECT_VERSION = 522;
CURRENT_PROJECT_VERSION = 525;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = CotEditor/Info.plist;
MARKETING_VERSION = 4.3.2;
MARKETING_VERSION = 4.3.3;
OTHER_SWIFT_FLAGS = "$(inherited) -D SPARKLE";
PRODUCT_BUNDLE_IDENTIFIER = com.coteditor.CotEditor;
PRODUCT_NAME = CotEditor;
Expand All @@ -4513,10 +4513,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CURRENT_PROJECT_VERSION = 522;
CURRENT_PROJECT_VERSION = 525;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = CotEditor/Info.plist;
MARKETING_VERSION = 4.3.2;
MARKETING_VERSION = 4.3.3;
OTHER_SWIFT_FLAGS = "$(inherited) -D SPARKLE";
PRODUCT_BUNDLE_IDENTIFIER = com.coteditor.CotEditor;
PRODUCT_NAME = CotEditor;
Expand Down
Binary file not shown.
Expand Up @@ -14,6 +14,26 @@
<h1>Release notes for CotEditor</h1>


<article>
<header>
<h1>CotEditor 4.3.3</h1>
<p>release: <time>2022-08-13</time></p>
</header>


<section>
<h2>Fixes</h2>

<ul>
<li>Fix an issue that the application could hang up when an opened document shared in iCloud Drive was modified in another machine.</li>
<li>Fix an issue that document windows sometimes did not shift the initial position from the last window.</li>
<li>Fix an issue that the scrollable area of the editor in vertical layout orientation could be clipped wrongly when scaled.</li>
<li>Fix an issue that some text was not localized.</li>
</ul>
</section>
</article>


<article>
<header>
<h1>CotEditor 4.3.2</h1>
Expand Down Expand Up @@ -78,7 +98,7 @@ <h2>Improvements</h2>
<h2>Fixes</h2>

<ul>
<li>Fix an issue that memory rarely leaks on closing documents.</li>
<li>Fix an issue that memory rarely leaked on closing documents.</li>
</ul>
</section>
</article>
Expand Down
Binary file not shown.
Expand Up @@ -14,6 +14,26 @@
<h1>CotEditorのリリースノート</h1>


<article>
<header>
<h1>CotEditor 4.3.3</h1>
<p>リリース: <time>2022-08-13</time></p>
</header>


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

<ul>
<li>iCloudドライブ上の書類を別のコンピュータから編集するとアプリケーションがハングすることがあった不具合を修正</li>
<li>新しいウインドウが前のウインドウからずれずに全く同じ位置に表示されることがあった不具合を修正</li>
<li>縦書きのエディタを拡大/縮小するとスクロールエリアが誤ってクリップさることがあった不具合を修正</li>
<li>ローカライズされていなかったテキストを修正</li>
</ul>
</section>
</article>


<article>
<header>
<h1>CotEditor 4.3.2</h1>
Expand Down Expand Up @@ -3320,7 +3340,7 @@ <h2>改良</h2>
<ul>
<li>ファイルオープン時にシンタックスが特定できなかったときは、デフォルトシンタックスではなく「なし」になるように変更</li>
<li>サイズの大きい書類で「すべて置換」をしたときの処理時間を大幅に改善</li>
<li>CotEdior が最前のアプリケーションでないときにもコンソールパネルを隠さないように変更</li>
<li>CotEditor が最前のアプリケーションでないときにもコンソールパネルを隠さないように変更</li>
<li>サイズの大きい書類でのシンタックスハイライト解析時間を改善</li>
<li>サイズの大きい書類のウインドウクローズ処理を改善</li>
<li>半透明ビューでのサイズの大きい書類の描画時間を改善(不透明ビューと同等ではないが以前よりも改善)</li>
Expand Down
50 changes: 16 additions & 34 deletions CotEditor/Sources/Document.swift
Expand Up @@ -727,43 +727,25 @@ final class Document: NSDocument, AdditionalDocumentPreparing, EncodingHolder {
UserDefaults.standard[.documentConflictOption] != .ignore,
!self.isExternalUpdateAlertShown, // don't check twice if already notified
let fileURL = self.fileURL
else { return }
else { return }

var didChange = false
var fileModificationDate: Date?
var coordinatorError: NSError?
NSFileCoordinator(filePresenter: self).coordinate(readingItemAt: fileURL, options: .withoutChanges, error: &coordinatorError) { (newURL) in // FILE_READ
let data: Data
do {
// ignore if file's modificationDate is the same as document's modificationDate
fileModificationDate = try FileManager.default.attributesOfItem(atPath: newURL.path)[.modificationDate] as? Date
guard fileModificationDate != self.fileModificationDate else { return }

// check if file contents was changed from the stored file data
data = try Data(contentsOf: newURL, options: [.mappedIfSafe])
} catch {
return assertionFailure(error.localizedDescription)
}
didChange = (data != self.fileData)
}
if let error = coordinatorError {
assertionFailure(error.localizedDescription)
// check wheather the document content is really modified
// -> Avoid using NSFileCoordinator although the document recommends
// because it cause deadlock when the document in the iCloud Document remotely modified.
// (2022-08 on macOS 12.5, Xcode 14, #1296)
let data: Data
do {
// ignore if file's modificationDate is the same as document's modificationDate
let fileModificationDate = try FileManager.default.attributesOfItem(atPath: fileURL.path)[.modificationDate] as? Date
guard fileModificationDate != self.fileModificationDate else { return }

// check if file contents was changed from the stored file data
data = try Data(contentsOf: fileURL, options: [.mappedIfSafe])
} catch {
return assertionFailure(error.localizedDescription)
}

guard didChange else {
// update the document's fileModificationDate for a workaround (2014-03 by 1024jp)
// -> If not, an alert shows up when user saves the file.
DispatchQueue.main.async { [weak self] in
guard
let lastModificationDate = self?.fileModificationDate,
let fileModificationDate = fileModificationDate,
lastModificationDate < fileModificationDate
else { return }

self?.fileModificationDate = fileModificationDate
}
return
}
guard data != self.fileData else { return }

// notify about external file update
DispatchQueue.main.async { [weak self] in
Expand Down
4 changes: 1 addition & 3 deletions CotEditor/Sources/DocumentWindowController.swift
Expand Up @@ -60,10 +60,8 @@ final class DocumentWindowController: NSWindowController, NSWindowDelegate {

super.windowDidLoad()

// -> It's set as false by default if the window controller was invoked from a storyboard.
self.shouldCascadeWindows = true
// -> Do not use "document" for autosave name because somehow windows forget the size with that name. (2018-09)
self.windowFrameAutosaveName = "Document Window"
self.windowFrameAutosaveName = "Document"

// set window size
let width = UserDefaults.standard[.windowWidth]
Expand Down
3 changes: 2 additions & 1 deletion CotEditor/Sources/EditorTextView.swift
Expand Up @@ -325,7 +325,8 @@ final class EditorTextView: NSTextView, Themable, CurrentLineHighlighting, URLDe
/// append inset only to the bottom for overscroll
override var textContainerOrigin: NSPoint {

return NSPoint(x: super.textContainerOrigin.x, y: Self.textContainerInset.height)
NSPoint(x: super.textContainerOrigin.x, y: Self.textContainerInset.height)
.offsetBy(dy: (self.layoutOrientation == .vertical) ? self.bounds.minY.rounded() : 0)
}


Expand Down
6 changes: 0 additions & 6 deletions CotEditor/Sources/NSTextView+Layout.swift
Expand Up @@ -117,12 +117,6 @@ extension NSTextView {
self.scaleUnitSquare(to: NSSize(width: scale, height: scale))
self.didChangeValue(for: \.scale)

// ensure bounds origin is {0, 0} for vertical text orientation
// to workaround AppKit-side bug (FB5703371).
if self.layoutOrientation == .vertical {
self.translateOrigin(to: self.bounds.origin)
}

// reset minimum size for unwrap mode
let visibleRect = self.enclosingScrollView?.documentVisibleRect ?? self.visibleRect
self.minSize = visibleRect.size
Expand Down
1 change: 1 addition & 0 deletions CotEditor/de.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Tabulatorbreite";
"Custom…" = "Konfigurieren …";
"Auto-Expand Tabs" = "Tabulatoren automatisch expandieren";

"Wrap Lines" = "Zeilen umbrechen";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/en-GB.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Tab Width";
"Custom…" = "Custom…";
"Auto-Expand Tabs" = "Auto-Expand Tabs";

"Wrap Lines" = "Wrap Lines";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/fr.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Largeur de tabulation";
"Custom…" = "Personnalisé…";
"Auto-Expand Tabs" = "Convertir automatiquement les tabulations";

"Wrap Lines" = "Renv. à la ligne";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/it.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Larghezza Tab";
"Custom…" = "Personalizzato…";
"Auto-Expand Tabs" = "Espandi Tab automaticamente";

"Wrap Lines" = "Aapo automatico";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/ja.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "タブ幅";
"Custom…" = "カスタム…";
"Auto-Expand Tabs" = "タブを自動でスペースに展開";

"Wrap Lines" = "行を折り返す";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/pt.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Largura da Tabulação";
"Custom…" = "Personalizar…";
"Auto-Expand Tabs" = "Expandir Tabulações Automaticamente";

"Wrap Lines" = "Ajustar Linhas";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/tr.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Sekme Genişliği";
"Custom…" = "Özel…";
"Auto-Expand Tabs" = "Sekmeleri Kendiliğinden Genişlet";

"Wrap Lines" = "Satırları Kaydır";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/zh-Hans.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Tab宽度";
"Custom…" = "自定义…";
"Auto-Expand Tabs" = "Tab转为空格";

"Wrap Lines" = "换行";
// tooltip
Expand Down
1 change: 1 addition & 0 deletions CotEditor/zh-Hant.lproj/Localizable.strings
Expand Up @@ -274,6 +274,7 @@
// menu
"Tab Width" = "Tab寬度";
"Custom…" = "自訂…";
"Auto-Expand Tabs" = "Tab轉為空格";

"Wrap Lines" = "換行";
// tooltip
Expand Down

0 comments on commit d14ecd0

Please sign in to comment.