Repository navigation
Conversation
- "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
- Composing word at the cursor is deleted by one swipe - Cursor inside a composing word: only the part before it is deleted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
With
Full keyboard swipe gestureset toDelete word, swiping left while a word is still being typed (underlined) did not delete it. The word was only finalized, and a second swipe was needed. This PR makes the first swipe delete it.Motivation & Context
No issue filed for this. The gesture was added for #757.
Steps to reproduce on current
main:Gesture typing > Full keyboard swipe gesturetoDelete word.hello worand do not press space.Expected:
woris deleted.Actual:
worstays and loses its underline. A second swipe deletes it.Side effects of the same bug:
Root cause: in the composing branch of
InputLogic.deleteWordBeforeCursor(),finishComposingText()ran beforecommitText("", 1). After the finish there is no composing span left, so the empty commit replaced nothing, and the branch returned early.Changes Made
handleBackspaceRepeatWordDeletion()already treats a composing word.InputLogic.kt, nothing added.InputLogicTestfor a composing word: cursor at its end, and cursor inside it.Verification & Testing
./gradlew :app:assembleStandardDebug(built with
./gradlew assembleDebug, standard and offline, on GitHub Actions in my fork: https://github.com/zoickx/LeanType/actions/runs/44590999769, no warnings inInputLogic.kt)(debug APK from that build on LineageOS 23.2 (Android 16): composing word, cursor inside a word, word followed by a space)
(the change only removes calls, and the code runs only on the swipe gesture)
(not applicable, no UI change)
./gradlew :app:testStandardRunTestsUnitTest --tests 'helium314.keyboard.latin.InputLogicTest': 130 tests, 0 failed, 1 skipped. Without the fix the two new tests fail. Run on my fork: https://github.com/zoickx/LeanType/actions/runs/44598065997Guidelines Checklist
Note, out of scope
There are three separate implementations of "delete the word before the cursor": this gesture, hold-backspace word deletion, and the delete key swipe with
Delete word by word. The first two sharegetStartOfPreviousWord()and keep the space before the word. The delete key swipe usesgetWordBoundariesBackwards()and removes that space too. This PR does not change any of that. I only mention it in case the difference is not intended.