From 2bfc03440d102fde8e4490a4977e1e22a814f4e8 Mon Sep 17 00:00:00 2001 From: Ilia Zaichuk Date: Thu, 19 Nov 2026 20:23:15 +0200 Subject: [PATCH 1/2] fix(swipe): delete composing word on full keyboard swipe - "Delete word" swipe finalized the word being typed, deleted nothing - Cause: finishComposingText() before commitText(""), so the empty commit had no composing span to replace - Now: finalize, then fall through to the regular deletion, same as hold-backspace word deletion --- .../java/helium314/keyboard/latin/inputlogic/InputLogic.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.kt b/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.kt index e2561fdd9..4ead40cfc 100644 --- a/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.kt +++ b/app/src/main/java/helium314/keyboard/latin/inputlogic/InputLogic.kt @@ -1683,11 +1683,7 @@ class InputLogic( } mWordComposer.reset() mConnection.finishComposingText() - mConnection.commitText("", 1) resetComposingState(true) - mSuggestionStripViewAccessor.setNeutralSuggestionStrip() - mLatinIME.feedbackForDeletedWord() - return } val textBefore = mConnection.getTextBeforeCursor(BACKSPACE_WORD_LOOKBACK, 0)?.toString() From e05603918b93a42d6ed441c70ad3c4896a20e998 Mon Sep 17 00:00:00 2001 From: Ilia Zaichuk Date: Thu, 19 Nov 2026 21:18:20 +0200 Subject: [PATCH 2/2] test(swipe): cover delete word swipe on a composing word - Composing word at the cursor is deleted by one swipe - Cursor inside a composing word: only the part before it is deleted --- .../keyboard/latin/InputLogicTest.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt b/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt index 912e6a1a0..caf136758 100644 --- a/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt +++ b/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt @@ -1687,6 +1687,30 @@ class InputLogicTest { assertEquals("ein", text) // with word deletion, "eins" would be gone completely } + @Test fun `delete word swipe deletes the composing word`() { + reset() + setText("hello ") + chainInput("there") + assertEquals("there", composingText) + inputLogic.deleteWordBeforeCursor() + handleMessages() + checkConnectionConsistency() + assertEquals("hello ", text) + assertEquals("", composingText) + } + + @Test fun `delete word swipe inside a composing word deletes up to the cursor`() { + reset() + setText("hello there") + setCursorPosition(8) // after h in there + assertEquals("there", composingText) + inputLogic.deleteWordBeforeCursor() + handleMessages() + checkConnectionConsistency() + assertEquals("hello ere", text) + assertEquals(6, cursor) + } + @Test fun timestamp() { reset() chainInput("hello")