diff --git a/Source/Modules/SessionCtl_HandleStates.swift b/Source/Modules/SessionCtl_HandleStates.swift index 378a3168..739841d7 100644 --- a/Source/Modules/SessionCtl_HandleStates.swift +++ b/Source/Modules/SessionCtl_HandleStates.swift @@ -145,6 +145,7 @@ extension SessionCtl { /// 遞交組字區內容。 /// 注意:必須在 IMK 的 commitComposition 函式當中也間接或者直接執行這個處理。 private func commit(text: String) { + let text = text.trimmingCharacters(in: .newlines) guard let client = client(), !text.isEmpty else { return } let buffer = ChineseConverter.kanjiConversionIfRequired(text) if buffer.isEmpty {