fix debug mode crash sometimes occurring when deleting korean

fixes GH-1551
This commit is contained in:
Helium314 2025-05-10 17:37:20 +02:00
parent 549675d8d7
commit e6ec1c7bca
2 changed files with 12 additions and 0 deletions

View file

@ -452,6 +452,8 @@ public final class InputLogic {
// to the current word instead of considering the cursor position
// position is actually not visible to the combiner, how to fix?
processedEvent = mWordComposer.processEvent(hangulDecodedEvent);
if (event.getMKeyCode() == KeyCode.DELETE)
mWordComposer.resetInvalidCursorPosition();
} else {
mWordComposer.setHangul(false);
final boolean wasComposingWord = mWordComposer.isComposingWord();

View file

@ -160,6 +160,16 @@ class InputLogicTest {
assertEquals("ㅛ.", text)
}
// see issue 1551 (debug only)
@Test fun deleteHangul() {
reset()
currentScript = ScriptUtils.SCRIPT_HANGUL
setText("ㅛㅛ ")
functionalKeyPress(KeyCode.DELETE)
functionalKeyPress(KeyCode.DELETE)
functionalKeyPress(KeyCode.DELETE)
}
@Test fun separatorUnselectsWord() {
reset()
setText("hello")