Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

vim: Revert 'Y' to yank to end of line (#17563)

Vishal Bhavsar89ae97e5e99f
diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json
index 8bb5ac72fe6..f863e8488a0 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 c9d3a7a4725..ae560acc299 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>) {
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>) {
- 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>) {
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 53038a69e9f..00000000000
--- 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"}}