Add redo support to Vim composer history (#42140)

## What changed

- Add a bounded redo stack for complete composer drafts, including paste payloads and image attachments. `Ctrl+R` now reapplies the last undone edit in Vim normal mode, while new edits clear stale redo history.
- Add the configurable `vim_normal.redo` action to the keymap schema and picker. Preserve reverse prompt-history search in Vim insert mode and non-Vim mode, and honor explicitly configured bindings.
- Keep pending edit snapshots outside the shared undo/redo byte budget so canceled commands cannot evict committed history.

## Testing

- Cover grouped edits, Vim searches, direct draft changes, history limits, empty redo stacks, and custom or unbound shortcuts.

GitOrigin-RevId: 0cf5bb376ff865ddc0a77705dcb322ef6b57b3a3
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-01 21:30:27 +00:00
1 parent 612e6491d5
commit b192442fc7
18 files changed
+318 -59

No files matched your search

+15 -1
View File
@@ -1121,7 +1121,7 @@ mod tests {
}
#[test]
fn picker_repeat_last_change_render_snapshot() {
fn picker_repeat_and_redo_render_snapshots() {
let runtime = RuntimeKeymap::defaults();
let params = build_keymap_picker_params_for_selected_action(
&runtime,
@@ -1136,6 +1136,20 @@ mod tests {
.expect("repeat-last-change row should render");
assert_snapshot!("keymap_picker_repeat_last_change", repeat_row);
let params = build_keymap_picker_params_for_selected_action(
&runtime,
&TuiKeymap::default(),
"vim_normal",
"redo",
);
let rendered = render_picker(params, /*width*/ 120);
let redo_row = rendered
.lines()
.find(|line| line.contains("Redo"))
.expect("redo row should render");
assert_snapshot!("keymap_picker_redo", redo_row);
}
#[test]