Fix ReplaceWithRegister with proper dot repeat (#24932)
Release Notes: - Fixed ReplaceWithRegister with proper dot repeat
This commit is contained in:
parent
1b38b9f61d
commit
14289b5a6e
2 changed files with 32 additions and 0 deletions
|
@ -850,4 +850,35 @@ mod test {
|
||||||
let clipboard: Register = cx.read_from_clipboard().unwrap().into();
|
let clipboard: Register = cx.read_from_clipboard().unwrap().into();
|
||||||
assert_eq!(clipboard.text, "fish");
|
assert_eq!(clipboard.text, "fish");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[gpui::test]
|
||||||
|
async fn test_replace_with_register_dot_repeat(cx: &mut gpui::TestAppContext) {
|
||||||
|
let mut cx = VimTestContext::new(cx, true).await;
|
||||||
|
|
||||||
|
cx.set_state(
|
||||||
|
indoc! {"
|
||||||
|
ˇfish one
|
||||||
|
two three
|
||||||
|
"},
|
||||||
|
Mode::Normal,
|
||||||
|
);
|
||||||
|
cx.simulate_keystrokes("y i w");
|
||||||
|
cx.simulate_keystrokes("w");
|
||||||
|
cx.simulate_keystrokes("g r i w");
|
||||||
|
cx.assert_state(
|
||||||
|
indoc! {"
|
||||||
|
fish fisˇh
|
||||||
|
two three
|
||||||
|
"},
|
||||||
|
Mode::Normal,
|
||||||
|
);
|
||||||
|
cx.simulate_keystrokes("j .");
|
||||||
|
cx.assert_state(
|
||||||
|
indoc! {"
|
||||||
|
fish fish
|
||||||
|
two fisˇh
|
||||||
|
"},
|
||||||
|
Mode::Normal,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -825,6 +825,7 @@ impl Vim {
|
||||||
| Operator::Uppercase
|
| Operator::Uppercase
|
||||||
| Operator::OppositeCase
|
| Operator::OppositeCase
|
||||||
| Operator::ToggleComments
|
| Operator::ToggleComments
|
||||||
|
| Operator::ReplaceWithRegister
|
||||||
) {
|
) {
|
||||||
self.start_recording(cx)
|
self.start_recording(cx)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue