diff --git a/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.java b/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.java index 76fdf66c6..9deabf6d0 100644 --- a/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.java +++ b/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.java @@ -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(); diff --git a/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt b/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt index 1fd8dea0b..afef5bbf0 100644 --- a/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt +++ b/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt @@ -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")