Repository navigation
Conversation
AryanRG
marked this pull request as ready for review
October 14, 2026 13:34
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.
Fixes #1467.
In Vi mode, typing
asdf, Escape, thenucurrently leavesasd; this restores the pre-3.0.4 result of an empty buffer. An earlier insert is preserved (xfollowed by a newasdfinsert undoes back tox). Emacs ControlUnderscore and repeated backspace grouping are covered as well.Named commands became
Bindingobjects in 3.0.4. Re-registering them throughKeyBindings.addsilently drops the explicitsave_beforecallbacks already supplied by the built-in self-insert, delete and Emacs undo bindings. This change makes an explicit callable take effect, while omitted callbacks continue to inherit the source binding's callback.This deliberately changes public API precedence:
KeyBindings.add(..., save_before=f)(existing_binding)now usesf. Existing-Binding precedence was not documented; explicit-caller precedence is inferred from the parameter description, the built-in callers and historical behavior. Omittingsave_beforeor passingNoneinherits the source callback. Plain-handler registration with an omitted or callable value keeps its existing behavior; explicitNonenow means omitted instead of failing when called. The public signature default changes toNone. Falsy callable objects remain valid overrides. TheBindingconstructor and generickey_binding()decorator keep their existing defaults, and other binding metadata handling is unchanged.If preserving explicit-callback precedence for custom
Bindingobjects is preferred, an alternative is an unspecified-callback marker limited to named commands. This patch chooses the consistent publicaddbehavior and documents it. It leaves the buffer undo/redo implementation unchanged; #2083 addresses separate redo invalidation behavior.Validation:
ruff check .,ruff format --check ., andtypos .passed.mypy --strict src/passed forwin32,linux, anddarwin(145 source files each).AI assistance: AI agents implemented the change and performed separate automated plan and final reviews, including executable checks. Submitted as a draft for maintainer feedback on the API tradeoff; the issue has no maintainer statement endorsing this approach. Review may take time given the existing PR queue.