From 7d30175527b0a588e6414f6bb562fb9d25c3c9ef Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 19 Jul 2024 01:54:59 +0800 Subject: [PATCH] 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 --- crates/vim/src/vim.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rs index 43915d796dc69c8bb6fee0a41cedc636b359985d..74c17f7bf179f45c9402ce01d3e72232532584e4 100644 --- a/crates/vim/src/vim.rs +++ b/crates/vim/src/vim.rs @@ -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);