Skip to content

fix(keymap): honor command-mode aliases across navigation contexts - #274

Merged
fcoury merged 1 commit into
mainfrom
fcoury/command-mode-aliases
Aug 18, 2026
Merged

fix(keymap): honor command-mode aliases across navigation contexts#274
fcoury merged 1 commit into
mainfrom
fcoury/command-mode-aliases

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Summary

Mapping ; to EnterMode = "Command" worked in normal editor mode, but embedded composers and transcripts consumed it as a character-search repeat. Visual modes also failed to inherit the command-entry binding.

Resolve configured command-entry actions before panel and workspace navigation, and inherit them in visual modes while respecting explicit visual-mode overrides. Insert-mode text, search queries, workspace filters, and unfinished Vim commands retain their input. The default ; character-search behavior is unchanged when no alias is configured.

Adds nine regression tests in src/editor/command_mode.rs and documents the existing keymap configuration; no new setting is required.

How to Test

  1. Add this binding to the user config and run cargo run:

    [keys.normal]
    ";" = { EnterMode = "Command" }
  2. Press ; in normal mode, then in each visual mode (v, V, and Ctrl-v). The command prompt should open; visual selections should retain the '<,'> command range.

  3. Open the agent pane, enter a draft, press Escape to enter composer normal mode, then press ;. Escape should return without changing the draft or focus. Repeat from transcript navigation and from :GitDashboard.

  4. Check that ; still types normally in insert mode and search/filter fields. In normal mode, f; must search for a semicolon rather than open the command prompt. An explicit [keys.visual] override should take precedence.

  5. Run cargo test -p red --lib command_mode::tests -- --test-threads=1 to exercise the focused regressions.

Validation

  • Focused regressions: 9 passed.
  • Full all-targets/all-features suite: 2,816 passed, 1 ignored.
  • cargo clippy --all-targets --all-features -- -D warnings passed.
  • Formatting and diff checks passed.

@fcoury
fcoury merged commit 7a668a4 into main Aug 18, 2026
12 checks passed
@fcoury
fcoury deleted the fcoury/command-mode-aliases branch August 18, 2026 01:32
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.

2 participants