Repository navigation
feat: add single-line command and field editing - #3
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ad57e8a3a
ℹ️ 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".
| Cancelled | ||
| } | ||
| Key::Backspace | Key::Ctrl('h') => self.edit(previous, self.caret, ""), | ||
| Key::Delete if self.caret == self.text.len() => self.edit(previous, self.caret, ""), |
There was a problem hiding this comment.
Cancel empty command prompts on Delete
For an empty Ex or search prompt, Key::Delete reaches edit(0, 0, ""), returns Consumed, and leaves the prompt open. Neovim routes Delete through the same empty-command cancellation logic as Backspace; see command_line_erase_chars. Consequently, pressing Delete to dismiss an empty prompt fails, and subsequent typing is still captured as command/search input. Include Delete in the empty-draft cancellation guard while preserving the existing behavior for PromptKind::Field.
AGENTS.md reference: AGENTS.md:L5-L5
Useful? React with 👍 / 👎.
Human-written TL;DR
Human will write this summary
AI-written summary
Ex commands, search patterns, and single-line fields need Vim command-line behavior without opening a modal document session. Add
CommandLinefor a UTF-8 draft, grapheme-safe caret movement, literal first-line paste, and explicit outcomes for acceptance, cancellation, history, and completion. The host supplies history and completion candidates and handles what happens after acceptance.How to Test
cargo test --locked --test command_line.nvim --headless -u NONE -i NONE -n -l scripts/command_line_reference.luawith Neovim 0.12.1. The fixtures cover editing in the middle of the line, CRLF paste, and different empty Backspace behavior for commands and fields.