Repository navigation
feat: honor readline keybindings in the comment composer - #45
Merged
Merged
Conversation
Adds the Emacs/readline chord set to the in-app editor: Ctrl+A/E line bounds, Ctrl+F/B/P/N motion, Alt+F/B word motion, Ctrl+W and Alt+Backspace word kills with their distinct whitespace vs letter/digit boundaries, Alt+D forward kill, Ctrl+K/Ctrl+U line kills (Ctrl+U never merges lines at column zero), Ctrl+D delete, and a single-slot kill buffer yanked by Ctrl+Y. Kill chords respect the posting freeze, Alt chords are explicit exceptions to the stray-escape guard, and Ctrl+S/Ctrl+C keep submit and cancel.
An infinite-loop mutant cannot pass the suite; it hangs and is detected by the timeout. cargo mutants exits 3 for that case, which must not fail the gate. Missed mutants (exit 2) still fail.
osolmaz
force-pushed
the
feat/composer-readline-keys
branch
from
July 26, 2026 06:25
99c3521 to
a14788b
Compare
Owner
Author
|
Final report: merged as 5c96c8e. Full readline tier 1+2 in the composer with a single-slot kill buffer; boundary-heavy tests drove in-diff mutants to 0 missed (6 timeout-only = infinite-loop mutants detected by hanging; the gate now accepts cargo-mutants exit 3 for that case). Codex review clean on the first pass. Deliberate v1 simplifications noted in the body: per-draft kill buffer, replace-not-append kills. |
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
The comment composer only understood arrows, Home/End, and Backspace, so shell muscle memory (Ctrl+A, Ctrl+K, Ctrl+W…) hit dead keys.
This change teaches the composer the readline/Emacs chord set that every shell, REPL, and macOS text field honors.
Line motion, word motion, word and line kills with a yank buffer, and delete-under-cursor all work now, with submit (Ctrl+S) and cancel (Ctrl+C/Esc) unchanged.
What Changed
All editing logic lives in the pure composer; the reducer only routes chords, so every behavior is unit-tested without a terminal.
kill_to_end(Ctrl+K; at end of line it kills the newline like readline),kill_to_start(Ctrl+U; a no-op at column zero so lines never merge),kill_word_back(Ctrl+W, whitespace-delimited),kill_word_back_alnum(Alt+Backspace, letter/digit boundary),kill_word_forward(Alt+D), word motion (Alt+F/Alt+B, crossing lines), and a single-slot kill buffer yanked by Ctrl+Y.text-input-keybindingsskill in the tools repo is the design source.Testing
cargo fmt --check,check --all-targets,clippy --all-targets --all-features -- -D warnings: cleancargo test: 702 tests pass (~15 new: op boundaries incl. the Ctrl+W vs Alt+Backspace boundary distinction, newline-kill/yank round trips, column-zero guards, freeze interaction, Ctrl+Alt inertness)cargo llvm-cov --fail-under-lines 85and executingcargo mutants --in-diffrun locally; CI runs both againRisks
Low — additive bindings on an already-tested editor core; no existing chord changed meaning.