Change timing to apply editor sesttings to the textStorage

This commit is contained in:
1024jp 2024-07-03 00:23:24 +09:00
parent be117577d0
commit 356186cf0f

View File

@ -322,7 +322,6 @@ extension Document: EditorSource {
// do nothing if already no textView exists // do nothing if already no textView exists
guard !selection.isEmpty else { return } guard !selection.isEmpty else { return }
self.applyContentToWindow()
self.textStorage.restoreEditorSelection(selection) self.textStorage.restoreEditorSelection(selection)
} }
@ -412,6 +411,8 @@ extension Document: EditorSource {
self.setSyntax(name: syntaxName ?? SyntaxName.none, isInitial: true) self.setSyntax(name: syntaxName ?? SyntaxName.none, isInitial: true)
} }
self.isInitialized = true self.isInitialized = true
self.viewController?.invalidateStyleInTextStorage()
} }
} }
@ -1079,7 +1080,6 @@ extension Document: EditorSource {
guard let viewController = self.viewController else { return } guard let viewController = self.viewController else { return }
// update view // update view
viewController.invalidateStyleInTextStorage()
if self.isVerticalText { if self.isVerticalText {
viewController.verticalLayoutOrientation = true viewController.verticalLayoutOrientation = true
} }