Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MarkEditCore/Sources/Extensions/EditorConfig+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import Foundation

public extension EditorConfig {
var toHtml: String {
indexHtml?
Self.indexHtml?
.replacingOccurrences(of: "/chunk-loader/", with: "chunk-loader://")
.replacingOccurrences(of: "\"{{EDITOR_CONFIG}}\"", with: jsonEncoded) ?? ""
}
}

extension EditorConfig {
/// index.html built by CoreEditor.
private var indexHtml: String? {
private static let indexHtml: String? = {
guard let path = Bundle.main.url(forResource: "index", withExtension: "html") else {
fatalError("Missing dist/index.html to set up the editor. In the wiki, see Building CoreEditor.")
}

return try? Data(contentsOf: path).toString()
}
}()
}
2 changes: 1 addition & 1 deletion MarkEditMac/Sources/Main/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
}

DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
EditorReusePool.shared.warmUp()
}

Expand Down