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: Fix gU$ (#20057)

Conrad Irwinecb874db6209
diff --git a/crates/vim/src/normal/case.rs b/crates/vim/src/normal/case.rs
index 463bc627508..52e37bed4cd 100644
--- a/crates/vim/src/normal/case.rs
+++ b/crates/vim/src/normal/case.rs
@@ -28,6 +28,7 @@ impl Vim {
) {
self.stop_recording(cx);
self.update_editor(cx, |_, editor, cx| {
+ editor.set_clip_at_line_ends(false, cx);
let text_layout_details = editor.text_layout_details(cx);
editor.transact(cx, |editor, cx| {
let mut selection_starts: HashMap<_, _> = Default::default();
@@ -52,6 +53,7 @@ impl Vim {
});
});
});
+ editor.set_clip_at_line_ends(true, cx);
});
}
@@ -261,7 +263,7 @@ mod test {
#[gpui::test]
async fn test_change_case_motion(cx: &mut gpui::TestAppContext) {
let mut cx = NeovimBackedTestContext::new(cx).await;
- // works in visual mode
+
cx.set_shared_state("ˇabc def").await;
cx.simulate_shared_keystrokes("g shift-u w").await;
cx.shared_state().await.assert_eq("ˇABC def");
@@ -281,5 +283,8 @@ mod test {
cx.simulate_shared_keystrokes(".").await;
cx.shared_state().await.assert_eq("ˇabc def");
+
+ cx.simulate_shared_keystrokes("g shift-u $").await;
+ cx.shared_state().await.assert_eq("ˇABC DEF");
}
}
diff --git a/crates/vim/test_data/test_change_case_motion.json b/crates/vim/test_data/test_change_case_motion.json
index 4d3600508f0..18921f08a2e 100644
--- a/crates/vim/test_data/test_change_case_motion.json
+++ b/crates/vim/test_data/test_change_case_motion.json
@@ -21,3 +21,7 @@
{"Get":{"state":"ˇABC def","mode":"Normal"}}
{"Key":"."}
{"Get":{"state":"ˇabc def","mode":"Normal"}}
+{"Key":"g"}
+{"Key":"shift-u"}
+{"Key":"$"}
+{"Get":{"state":"ˇABC DEF","mode":"Normal"}}