vim: Fix cgn backwards movement when there is no matches (#10237)
Release Notes: - Fixed `cgn` backwards movement problem in #9982 There are two issues: - When there are no more matches, the next repetition still moves the cursor to the left. After that, the recording is cleared. For this I simply move the cursor to the right, but it doesn't work when the cursor is at the end of the line. - If `cgn` is used when there are no matches, it cleans the previous recorded actions. Maybe there should be a way to revert the recording. This also happens when using `c` and `esc` --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
0390df27d4
commit
f9bf60f017
5 changed files with 79 additions and 3 deletions
|
@ -341,6 +341,10 @@ impl Vim {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn stop_replaying(&mut self) {
|
||||
self.workspace_state.replaying = false;
|
||||
}
|
||||
|
||||
/// When finishing an action that modifies the buffer, stop recording.
|
||||
/// as you usually call this within a keystroke handler we also ensure that
|
||||
/// the current action is recorded.
|
||||
|
@ -499,6 +503,7 @@ impl Vim {
|
|||
self.sync_vim_settings(cx);
|
||||
popped_operator
|
||||
}
|
||||
|
||||
fn clear_operator(&mut self, cx: &mut WindowContext) {
|
||||
self.take_count(cx);
|
||||
self.update_state(|state| state.operator_stack.clear());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue