Add Vim replace mode to the TUI composer (#42194)

## What changed

- Add Vim Replace mode, entered with `R`, which overwrites graphemes and appends at the end of a line.
- Restore overwritten text with Backspace and record replace edits for undo and dot-repeat.
- Preserve composer behavior for attachments, completions, paste bursts, history previews, and external editor imports while replacing text.
- Expose `vim_normal.enter_replace_mode` in the configurable TUI keymap.

## Testing

- Add coverage for grapheme replacement, Backspace recovery, dot-repeat, custom bindings, atomic attachments, completions, paste handling, and history interactions.

GitOrigin-RevId: cb04e3adcce013c1eb7b82c994b00e944310c481
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-02 03:35:41 +00:00
1 parent 02f47d3fb3
commit 5a0419edb5
22 files changed
+634 -53

No files matched your search

+2
View File
@@ -217,6 +217,8 @@ pub struct TuiVimNormalKeymap {
pub open_line_below: Option<KeybindingsSpec>,
/// Open a new line above and enter insert mode (`O`).
pub open_line_above: Option<KeybindingsSpec>,
/// Enter replace mode and overwrite characters under the cursor (`R`).
pub enter_replace_mode: Option<KeybindingsSpec>,
/// Move cursor left (`h`).
pub move_left: Option<KeybindingsSpec>,
/// Move cursor right (`l`).