From 177100ba2c81c5d5f9b099eb8b58b458b44928cc Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 25 Oct 2022 13:15:28 +0800 Subject: [PATCH] InputHandler // Clear calligrapher if it is overflown. --- Source/Modules/InputHandler_HandleComposition.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Modules/InputHandler_HandleComposition.swift b/Source/Modules/InputHandler_HandleComposition.swift index e1ef8e67..9a9e6782 100644 --- a/Source/Modules/InputHandler_HandleComposition.swift +++ b/Source/Modules/InputHandler_HandleComposition.swift @@ -200,10 +200,12 @@ extension InputHandler { delegate.switchState(newEmptyState) return true } - while isStrokesFull { - calligrapher = String(calligrapher.dropLast(1)) + if isStrokesFull { + delegate.callError("2268DD51: calligrapher is full, clearing calligrapher.") + calligrapher.removeAll() + } else { + calligrapher.append(input.text) } - calligrapher.append(input.text) if isWildcardKeyInput { break prehandling }