Skip to content

Commit eff01e9

Browse files
committed
Move warmUp to earliest stage
1 parent d71bef6 commit eff01e9

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

MarkEditMac/Sources/Editor/Controllers/EditorViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ extension EditorViewController {
316316
}
317317

318318
func resetEditor() {
319-
guard hasFinishedLoading else {
319+
guard hasFinishedLoading, let textContent = document?.stringValue else {
320320
return
321321
}
322322

323-
bridge.core.resetEditor(text: document?.stringValue ?? "") { _ in
323+
bridge.core.resetEditor(text: textContent) { _ in
324324
self.webView.magnification = 1.0
325325
self.bridge.textChecker.update(options: TextCheckerOptions(
326326
spellcheck: true,

MarkEditMac/Sources/Main/Application/AppDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
5555
private var appearanceObservation: NSKeyValueObservation?
5656
private var settingsWindowController: NSWindowController?
5757

58-
func applicationWillFinishLaunching(_ notification: Notification) {
59-
EditorReusePool.shared.warmUp()
60-
}
61-
6258
func applicationDidFinishLaunching(_ notification: Notification) {
6359
NSApp.appearance = AppPreferences.General.appearance.resolved()
6460
appearanceObservation = NSApp.observe(\.effectiveAppearance) { _, _ in

MarkEditMac/Sources/Main/Application/Application.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ final class Application: NSApplication {
2626

2727
// Must after AppCustomization.createFiles()
2828
Bundle.swizzleInfoDictionaryOnce
29+
EditorReusePool.shared.warmUp()
2930

3031
let application = Self.shared
3132
let delegate = AppDelegate()

0 commit comments

Comments
 (0)