mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Merge branch 'main' into 4.9.0
# Conflicts: # CotEditor/Sources/AppDelegate.swift
This commit is contained in:
commit
f487f4b58d
@ -29,12 +29,13 @@
|
||||
- Display the current editor mode in the document inspector.
|
||||
- Improve VoiceOver support.
|
||||
- Deprecate exact recalculation of insertion points when documents are updated by external processes to improve application stability.
|
||||
- Improve stability of application launch behavior.
|
||||
- [non-AppStore ver.] Update Sparkle from 2.6.0 to 2.6.2 (security update).
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue that the application could not responding by updating a relatively large document from external processes.
|
||||
- Fix an issue that the application could not respond by updating a relatively large document from external processes.
|
||||
- Fix an issue that the application unwontedly copied the bundled theme setting files to the user domain.
|
||||
- Fix an issue that the Share command was not available in the theme setting list.
|
||||
- Fix the layout of the Go To dialog.
|
||||
|
@ -115,11 +115,6 @@ private enum BundleIdentifier {
|
||||
UserDefaults.standard.migrateFontSetting()
|
||||
UserDefaults.standard.migrateOnLaunchSetting()
|
||||
}
|
||||
|
||||
ProcessInfo.processInfo.automaticTerminationSupportEnabled = true
|
||||
|
||||
// instantiate shared instances
|
||||
_ = DocumentController.shared
|
||||
}
|
||||
|
||||
|
||||
@ -226,12 +221,16 @@ private enum BundleIdentifier {
|
||||
|
||||
// MARK: Application Delegate
|
||||
|
||||
#if SPARKLE
|
||||
func applicationWillFinishLaunching(_ notification: Notification) {
|
||||
|
||||
ProcessInfo.processInfo.automaticTerminationSupportEnabled = true
|
||||
|
||||
_ = DocumentController.shared
|
||||
|
||||
#if SPARKLE
|
||||
UpdaterManager.shared.setup()
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
@ -271,6 +270,27 @@ private enum BundleIdentifier {
|
||||
}
|
||||
|
||||
|
||||
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
||||
|
||||
// not evaluated on the app launch (only on the *re*-open event)
|
||||
|
||||
// invoked only on the *re*-open event
|
||||
switch UserDefaults.standard[.noDocumentOnLaunchOption] {
|
||||
case .untitledDocument:
|
||||
if !flag {
|
||||
// show an untitled document before the app considers displaying the Open dialog
|
||||
NSDocumentController.shared.newDocument(nil)
|
||||
}
|
||||
return false
|
||||
case .openPanel:
|
||||
// the original behavior depends on whether iCloud is enabled:
|
||||
// -> On: the Open dialog
|
||||
// -> Off: an untitled document
|
||||
return true // entrust to `.applicationShouldOpenUntitledFile(_:)`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func application(_ sender: NSApplication, openFiles filenames: [String]) {
|
||||
|
||||
assert(Thread.isMainThread)
|
||||
|
@ -192,19 +192,6 @@ final class Document: NSDocument, AdditionalDocumentPreparing, EncodingChanging
|
||||
}
|
||||
|
||||
|
||||
override class var usesUbiquitousStorage: Bool {
|
||||
|
||||
// pretend as if iCloud storage is disabled to let the system give up opening the open panel on launch (2018-02 macOS 10.13)
|
||||
if UserDefaults.standard[.noDocumentOnLaunchOption] != .openPanel,
|
||||
NSDocumentController.shared.documents.isEmpty
|
||||
{
|
||||
return false
|
||||
}
|
||||
|
||||
return super.usesUbiquitousStorage
|
||||
}
|
||||
|
||||
|
||||
override class func canConcurrentlyReadDocuments(ofType: String) -> Bool {
|
||||
|
||||
true
|
||||
|
Loading…
Reference in New Issue
Block a user