fix(tui): complete vim word-end and line-end behavior#24380
Merged
Conversation
This was referenced May 25, 2026
canvrno-oai
approved these changes
May 26, 2026
etraut-openai
approved these changes
May 27, 2026
Collaborator
etraut-openai
left a comment
There was a problem hiding this comment.
Config change looks fine
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
The TUI Vim composer currently diverges from normal Vim editing in two common workflows: pressing
erepeatedly can remain stuck at an existing word end, and normal mode does not supportCfor changing through the end of the line. The existingDbehavior also removes the newline when the cursor is already at the line boundary, which makes the newCaction and existing deletion action surprising in multiline prompts.Closes #23926.
Closes #24238.
What Changed
eadvance from the current word end to the next word end, including for operator motions such asde.change_to_line_endbehavior, bound toCby default, which deletes to the end of the current line and enters Insert mode.DorCis pressed at the end-of-line boundary.e,de,C, and the multilineC/Dboundary behavior.How to Test
cd codex-rs cargo run --bin codex -- -c tui.vim_mode_default=truealpha beta gamma, pressEsc,0, then presserepeatedly.Confirm the cursor advances through the ends of
alpha,beta, andgamma.hello world, pressEsc,0,w, thenC.Confirm
worldis deleted and the composer enters Insert mode.helloaboveworld, pressEsc,k,$, and thenD.Confirm the newline is preserved and the two lines do not join.
Cand type!.Confirm the composer enters Insert mode and yields
hello!aboveworld, preserving the newline.Targeted automated verification:
just fix -p codex-tuijust argument-comment-lint-from-source -p codex-tui -p codex-configcargo insta pending-snapshotsreports no pending snapshots.just test -p codex-tuivalidates the new Vim and keymap snapshot coverage, but the command remains red due to two reproducible unrelated failures inapp::tests::update_feature_flags_disabling_guardian_*.Validation Note
The workspace-wide
just argument-comment-lintform is currently blocked during Bazel analysis by the existing LLVMcompiler-rtmissinginclude/sanitizer/*.hfailure; package-scoped source linting for the changed Rust crates passed.