Fix timing to invalidate editor style

This commit is contained in:
1024jp 2023-04-03 21:45:18 +09:00
parent e06aeae566
commit fe76987c5a
2 changed files with 11 additions and 1 deletions

View File

@ -5,6 +5,10 @@ Change Log
4.5.3 (unreleased)
--------------------------
### Fixes
- Fix an issue that the editor font did not applied to documents created via Services.
4.5.2 (562)

View File

@ -245,10 +245,16 @@ final class DocumentController: NSDocumentController {
@discardableResult
func openUntitledDocument(content: String, title: String? = nil, display displayDocument: Bool) throws -> Document {
let document = try self.transientDocument ?? (try self.openUntitledDocumentAndDisplay(displayDocument) as! Document)
let document = try self.transientDocument ?? (try self.openUntitledDocumentAndDisplay(false) as! Document)
document.replaceContent(with: content)
document.updateChangeCount(.changeDone)
if displayDocument {
document.makeWindowControllers()
document.showWindows()
}
if let title {
document.displayName = title
document.windowControllers