Skip to content

fix(input): throttle held delete acceleration while the editor lags - #977

Merged
LeanBitLab merged 1 commit into
mainfrom
fix/held-delete-lag
Nov 28, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
fix/held-delete-lag

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Holding delete in a slow editor (browsers, web editors) kept deleting after the key was released: from the 21st repeat the acceleration sends up to 21 deletes per repeat, and the editor queues what it cannot apply in time.

Change

  • RichInputConnection: remember the cursor the editor last reported (onUpdateSelection, initialSelStart) and expose unappliedDeletionCount(), the chars we deleted that the editor has not applied yet.
  • InputLogic.getBackspaceExtraDeletes: cap extra deletes so at most 21 chars are unapplied. Covers all delete paths (web key events, normal fields, composing word, no-cursor fields).
  • No new setting. Editors that keep up keep full speed; editors that never report a cursor fall back to one delete per repeat. The normal single delete is never held back.

Verification

  • InputLogicTest: 154 tests, 0 failures (1 skipped), including the existing acceleration tests and two new ones (lagging normal field, lagging web editor).
  • Not tested on a device yet.

Fixes #972. Related: #971 (no toggle; acceleration now stays predictable).

Extra deletes are sent only while the editor has applied the earlier ones, so a slow editor queues at most about one repeat's worth and deletion stops when the key is released. Editors that keep up keep the full speed.

Fixes #972 (#971)
@LeanBitLab
LeanBitLab merged commit 555711a into main Nov 28, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/held-delete-lag branch November 28, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Holding delete key for long period of time causes laggy unwanted behavior

1 participant