From 6fce25ed2c32d6b302320c86f0b679277ff8e568 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 26 Oct 2022 11:14:54 +0800 Subject: [PATCH] SessionCtl // Stop committing unwanted newlines. --- Source/Modules/SessionCtl_HandleStates.swift | 1 + 1 file changed, 1 insertion(+) 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 {