diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json index 8bb5ac72fe6fc89ad527d4e8983c59d960f0f4b5..f863e8488a0e2853d7a088b25ac817467b30f95f 100644 --- a/assets/keymaps/vim.json +++ b/assets/keymaps/vim.json @@ -214,7 +214,7 @@ "shift-d": "vim::DeleteToEndOfLine", "shift-j": "vim::JoinLines", "y": ["vim::PushOperator", "Yank"], - "shift-y": "vim::YankToEndOfLine", + "shift-y": "vim::YankLine", "i": "vim::InsertBefore", "shift-i": "vim::InsertFirstNonWhitespace", "a": "vim::InsertAfter", diff --git a/crates/vim/src/normal.rs b/crates/vim/src/normal.rs index c9d3a7a4725ff5e243d25a25c96c5df31f2198bc..ae560acc2999e5ed19e24fb2ba895397ba0ffed9 100644 --- a/crates/vim/src/normal.rs +++ b/crates/vim/src/normal.rs @@ -52,7 +52,6 @@ actions!( DeleteToEndOfLine, Yank, YankLine, - YankToEndOfLine, ChangeCase, ConvertToUpperCase, ConvertToLowerCase, @@ -77,7 +76,6 @@ pub(crate) fn register(editor: &mut Editor, cx: &mut ViewContext) { Vim::action(editor, cx, Vim::convert_to_upper_case); Vim::action(editor, cx, Vim::convert_to_lower_case); Vim::action(editor, cx, Vim::yank_line); - Vim::action(editor, cx, Vim::yank_to_end_of_line); Vim::action(editor, cx, Vim::toggle_comments); Vim::action(editor, cx, Vim::paste); @@ -428,18 +426,6 @@ impl Vim { self.yank_motion(motion::Motion::CurrentLine, count, cx) } - fn yank_to_end_of_line(&mut self, _: &YankToEndOfLine, cx: &mut ViewContext) { - self.record_current_action(cx); - let count = self.take_count(cx); - self.yank_motion( - motion::Motion::EndOfLine { - display_lines: false, - }, - count, - cx, - ) - } - fn toggle_comments(&mut self, _: &ToggleComments, cx: &mut ViewContext) { self.record_current_action(cx); self.update_editor(cx, |_, editor, cx| { @@ -1408,15 +1394,6 @@ mod test { ); } - #[gpui::test] - async fn test_shift_y(cx: &mut gpui::TestAppContext) { - let mut cx = NeovimBackedTestContext::new(cx).await; - - cx.set_shared_state("helˇlo\n").await; - cx.simulate_shared_keystrokes("shift-y").await; - cx.shared_clipboard().await.assert_eq("lo"); - } - #[gpui::test] async fn test_r(cx: &mut gpui::TestAppContext) { let mut cx = NeovimBackedTestContext::new(cx).await; diff --git a/crates/vim/test_data/test_shift_y.json b/crates/vim/test_data/test_shift_y.json deleted file mode 100644 index 53038a69e9fb7d26e4556d50f3ac9622e0cadd30..0000000000000000000000000000000000000000 --- a/crates/vim/test_data/test_shift_y.json +++ /dev/null @@ -1,4 +0,0 @@ -{"Put":{"state":"helˇlo\n"}} -{"Key":"shift-y"} -{"Get":{"state":"helˇlo\n","mode":"Normal"}} -{"ReadRegister":{"name":"\"","value":"lo"}}