Skip to content

feat: add single-line command and field editing - #3

Merged
fcoury-oai merged 1 commit into
mainfrom
command-line-editor
Nov 14, 2026
Merged

fcoury-oai merged 1 commit into
mainfrom
command-line-editor

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

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 CommandLine for 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

  1. Run cargo test --locked --test command_line.
  2. Run nvim --headless -u NONE -i NONE -n -l scripts/command_line_reference.lua with 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T04:25:14.816052Z 3ad57e8 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fcoury-oai
fcoury-oai merged commit 23141c1 into main Nov 14, 2026
6 checks passed

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

Copy link
Copy Markdown

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: 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".

Comment thread src/command_line.rs
Cancelled
}
Key::Backspace | Key::Ctrl('h') => self.edit(previous, self.caret, ""),
Key::Delete if self.caret == self.text.len() => self.edit(previous, self.caret, ""),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@github-actions github-actions Bot mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant