Skip to content

[codex] Fix Vim normal mode editing#25022

Merged
jinghanx88 merged 1 commit into
mainfrom
jinghanx/vim-mode-open-substitute
May 29, 2026
Merged

[codex] Fix Vim normal mode editing#25022
jinghanx88 merged 1 commit into
mainfrom
jinghanx/vim-mode-open-substitute

Conversation

@jinghanx88
Copy link
Copy Markdown
Contributor

Summary

  • add Vim normal-mode s support to substitute the character under the cursor and enter insert mode
  • fix Vim normal-mode o so opening below the final line moves the cursor onto the new blank line
  • update keymap config/schema and keymap picker snapshots for the new action

Validation

  • just fmt
  • just write-config-schema
  • just test -p codex-config
  • focused just test -p codex-tui coverage for the Vim s and o behavior, keymap conflict handling, and keymap picker snapshots
  • cargo insta pending-snapshots --manifest-path tui/Cargo.toml
  • git diff --check

Notes

A full just test -p codex-tui run still has two unrelated Guardian feature-flag failures in this checkout:

  • app::tests::update_feature_flags_disabling_guardian_clears_review_policy_and_restores_default
  • app::tests::update_feature_flags_disabling_guardian_clears_manual_review_policy_without_history

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jinghanx88 jinghanx88 marked this pull request as ready for review May 29, 2026 05:50
@jinghanx88 jinghanx88 requested a review from a team as a code owner May 29, 2026 05:50
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5da1714b94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +739 to +740
if self.vim_normal_keymap.substitute_char.is_pressed(event) {
self.delete_forward_kill(/*n*/ 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid deleting line breaks for s on empty lines

When the cursor is on an empty Vim line, beginning_of_current_line() and end_of_current_line() are equal and the cursor points at the newline byte, so this new s path calls delete_forward_kill(1) and removes that newline before entering insert mode. In practice, pressing s on a blank line collapses it into the next line instead of just entering insert mode on the empty line, which is destructive for normal Vim editing of multi-line prompts.

Useful? React with 👍 / 👎.

@jinghanx88
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@jinghanx88
Copy link
Copy Markdown
Contributor Author

recheck

github-actions Bot added a commit that referenced this pull request May 29, 2026
@jinghanx88 jinghanx88 force-pushed the jinghanx/vim-mode-open-substitute branch from 5da1714 to 6600a19 Compare May 29, 2026 05:58
@jinghanx88 jinghanx88 merged commit f2e7b46 into main May 29, 2026
31 checks passed
@jinghanx88 jinghanx88 deleted the jinghanx/vim-mode-open-substitute branch May 29, 2026 21:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants