Add dot-repeat to Vim mode (#40521)

## What changed

- Bind `.` in Vim normal mode to repeat the last complete edit.
- Record semantic delete, change, replace, paste, and insert-mode actions so repeats preserve motions, text objects, inserted text, and editor actions across keymap changes.
- Expose `vim_normal.repeat_last_change` in the configurable keymap and keymap picker, including conflict handling for existing custom bindings.

## Testing

- Add coverage for repeating deletes, replacements, complete changes, pasted and literal text, insert-mode editor actions, custom bindings, unavailable motions, and cleared buffers.

GitOrigin-RevId: 3213df964811e7902377ff1d93641e59f4037914
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-08-25 02:34:04 +00:00
1 parent cbfd999db7
commit c1db22a3cd
16 files changed
+658 -71

No files matched your search

+18
View File
@@ -1099,6 +1099,24 @@ mod tests {
);
}
#[test]
fn picker_repeat_last_change_render_snapshot() {
let runtime = RuntimeKeymap::defaults();
let params = build_keymap_picker_params_for_selected_action(
&runtime,
&TuiKeymap::default(),
"vim_normal",
"repeat_last_change",
);
let rendered = render_picker(params, /*width*/ 120);
let repeat_row = rendered
.lines()
.find(|line| line.contains("Repeat Last Change"))
.expect("repeat-last-change row should render");
assert_snapshot!("keymap_picker_repeat_last_change", repeat_row);
}
#[test]
fn picker_all_tab_items_remain_searchable() {
let runtime = RuntimeKeymap::defaults();