Change summary
assets/keymaps/vim.json | 1 +
crates/vim/src/normal/paste.rs | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
Detailed changes
@@ -293,6 +293,7 @@
"!": "vim::ShellCommand",
"i": ["vim::PushObject", { "around": false }],
"a": ["vim::PushObject", { "around": true }],
+ "g r": ["vim::Paste", { "preserve_clipboard": true }],
"g c": "vim::ToggleComments",
"g q": "vim::Rewrap",
"\"": "vim::PushRegister",
@@ -849,6 +849,26 @@ mod test {
);
let clipboard: Register = cx.read_from_clipboard().unwrap().into();
assert_eq!(clipboard.text, "fish");
+
+ cx.set_state(
+ indoc! {"
+ ˇfish one
+ two three
+ "},
+ Mode::Normal,
+ );
+ cx.simulate_keystrokes("y i w");
+ cx.simulate_keystrokes("w");
+ cx.simulate_keystrokes("v i w g r");
+ cx.assert_state(
+ indoc! {"
+ fish fisˇh
+ two three
+ "},
+ Mode::Normal,
+ );
+ let clipboard: Register = cx.read_from_clipboard().unwrap().into();
+ assert_eq!(clipboard.text, "fish");
}
#[gpui::test]