vim: Add repeat support for add_surround (#14746)

Fix: #14242

At present, we don't trigger the method `start_recording(cx)` to start
recording when typing add_surround, so it can't be repeated well, delete
and change actually don't increase, but when entering `d` and `c`, it
happens that these two operations are recorded, I think maybe we also
need to call `start_recording(cx)` when calling delete_surround and
change_surround, otherwise when the user modifies their shortcuts, these
two functions may not be supported by repeat

Release Notes:

- N/A
This commit is contained in:
Hans 2024-07-19 01:54:59 +08:00 committed by GitHub
parent d044685706
commit 7d30175527
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -680,6 +680,9 @@ impl Vim {
| Operator::DeleteSurrounds
) {
self.update_state(|state| state.operator_stack.clear());
if let Operator::AddSurrounds { target: None } = operator {
self.start_recording(cx);
}
};
self.update_state(|state| state.operator_stack.push(operator));
self.sync_vim_settings(cx);