Feat: Add Option to Delete Whole Words When Holding Backspace#2329
Open
defleur-agents wants to merge 1 commit intoHeliBorg:mainfrom
Open
Feat: Add Option to Delete Whole Words When Holding Backspace#2329defleur-agents wants to merge 1 commit intoHeliBorg:mainfrom
defleur-agents wants to merge 1 commit intoHeliBorg:mainfrom
Conversation
Adds a new setting 'Hold backspace deletes whole words' under Text correction (off by default). When enabled: - Holding backspace deletes entire words instead of individual characters - Uses BreakIterator.getWordInstance() for accurate word boundary detection - Gradually increasing repeat speed with haptic feedback on each deletion - Composing words are deleted whole on first repeat - Works in both standard and TYPE_NULL input fields Default behavior is unchanged for users who don't enable the setting.
eranl
reviewed
Feb 27, 2026
Contributor
eranl
left a comment
There was a problem hiding this comment.
How does this deal with punctuation and other non-word characters?
| if (textBeforeCursor != null && textBeforeCursor.length() > 0) { | ||
| final java.text.BreakIterator breakIterator; | ||
| if (deleteWholeWords) { | ||
| breakIterator = java.text.BreakIterator.getWordInstance(); |
Contributor
There was a problem hiding this comment.
This uses the default locale. It also uses some built-in word-breaking logic, which differs between Android versions. And it ignores HeliBoard's word separators.
| if (autocorrectEnabled) Settings.PREF_AUTOCORRECT_SHORTCUTS else null, | ||
| if (autocorrectEnabled) Settings.PREF_AUTO_CORRECT_THRESHOLD else null, | ||
| if (autocorrectEnabled) Settings.PREF_BACKSPACE_REVERTS_AUTOCORRECT else null, | ||
| Settings.PREF_DELETE_WHOLE_WORDS, |
Contributor
There was a problem hiding this comment.
I think this setting belongs on the Preferences or Advanced screens.
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.
Adds a "Hold backspace deletes whole words" toggle in Text Correction settings (off by default). When enabled, holding the backspace key deletes entire words instead of individual characters.
Related: #1289 — this addresses the hold-backspace behavior discussed in that thread. The swipe-delete behavior requested in the original issue is not changed by this PR.
Implementation
BreakIterator.getWordInstance()for accurate word boundary detectionFiles Changed
InputLogic.java— word deletion logic for both composing and committed textPointerTracker.java— adjusted repeat timing when deleting wordsLatinIME.java— haptic feedback on every backspace repeat when enabledSettings.java/Defaults.kt/SettingsValues.java— new preferenceTextCorrectionScreen.kt— settings UIstrings.xml— setting label and description