Skip to content

[v0.3] Add minibuffer foundation #28

Description

@owainlewis

Goal: Add a real minibuffer foundation for prompt-driven editor interactions.

Context: Cortex currently has a slash command line, but search, find-file, switch-buffer, and M-x need a reusable prompt surface.
This should be a small foundation, not a full completion system yet.

Proposed approach:

  • Add minibuffer state to the app/editor state.
  • Render the minibuffer through the existing bottom chrome/modeline area or a clearly separated bottom prompt row.
  • Support prompt text, editable input, cursor movement within the prompt if practical, submit, cancel, and transient messages.
  • Route prompt completion back to command handlers instead of creating separate behavior paths.
  • Keep the slash command line behavior working, or explicitly fold it into the same prompt machinery if that keeps the code smaller.

Acceptance criteria:

  • A command can open a minibuffer prompt with a label and current input.
  • Printable keys edit the prompt without editing the buffer.
  • Enter submits the prompt to a caller-provided command path.
  • Escape cancels the prompt and restores normal editing.
  • Status messages and dirty quit prompts remain visually clear.
  • Existing slash commands still work.
  • Existing editor cursor placement is not broken.

Verification:

  • Run cargo test.
  • Manually open a prompt, type, submit, cancel, and return to editing.
  • Manually test slash commands, save, dirty quit, and terminal cleanup.

Out of scope:

  • Fuzzy completion.
  • File picker replacement.
  • Search implementation.
  • M-x command execution.
  • Multi-buffer switching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions