From 89d2884ea29a506423115911c0d5a3e985d050f7 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 8 Dec 2022 15:34:59 +0800 Subject: [PATCH] PhraseEditor // Implement tagOverrides(). - This affects both PhraseEditorCocoa and PhraseEditorUI. --- .../Sources/PhraseEditorUI/PhraseEditorUI.swift | 3 +++ .../Modules/WindowControllers/CtlPrefWindow_PhraseEditor.swift | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Packages/vChewing_PhraseEditorUI/Sources/PhraseEditorUI/PhraseEditorUI.swift b/Packages/vChewing_PhraseEditorUI/Sources/PhraseEditorUI/PhraseEditorUI.swift index c4fb44eb..bf0c26ee 100644 --- a/Packages/vChewing_PhraseEditorUI/Sources/PhraseEditorUI/PhraseEditorUI.swift +++ b/Packages/vChewing_PhraseEditorUI/Sources/PhraseEditorUI/PhraseEditorUI.swift @@ -176,6 +176,9 @@ public struct VwrPhraseEditorUI: View { DispatchQueue.main.async { isLoading = true delegate.consolidate(text: &txtContent, pragma: false) // 強制整理 + if selUserDataType == .thePhrases { + delegate.tagOverrides(in: &txtContent, mode: selInputMode) + } isLoading = false isSaved = false } diff --git a/Source/Modules/WindowControllers/CtlPrefWindow_PhraseEditor.swift b/Source/Modules/WindowControllers/CtlPrefWindow_PhraseEditor.swift index e0f47e6f..a6141800 100644 --- a/Source/Modules/WindowControllers/CtlPrefWindow_PhraseEditor.swift +++ b/Source/Modules/WindowControllers/CtlPrefWindow_PhraseEditor.swift @@ -172,6 +172,9 @@ extension CtlPrefWindow: NSTextViewDelegate, NSTextFieldDelegate { DispatchQueue.main.async { [self] in isLoading = true vChewingLM.LMConsolidator.consolidate(text: &tfdPETextEditor.string, pragma: false) + if selUserDataType == .thePhrases { + LMMgr.shared.tagOverrides(in: &tfdPETextEditor.string, mode: selInputMode) + } isLoading = false isSaved = false }