Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2CA committed Feb 21, 2025
1 parent ee1a559 commit 99cfef6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/keymaps/vim.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 20 additions & 0 deletions crates/vim/src/normal/paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 99cfef6

Please sign in to comment.