Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix issue where changing the case of a vim object would be clipped at the end of the line (#24163)
Ben Kunkledaf09fa532e6
diff --git a/crates/vim/src/normal/case.rs b/crates/vim/src/normal/case.rsindex fdebaac2610..778003784a6 100644--- a/crates/vim/src/normal/case.rs+++ b/crates/vim/src/normal/case.rs@@ -73,6 +73,7 @@ impl Vim {self.stop_recording(cx);self.update_editor(window, cx, |_, editor, window, cx| {editor.transact(window, cx, |editor, window, cx| {+ editor.set_clip_at_line_ends(false, cx);let mut original_positions: HashMap<_, _> = Default::default();editor.change_selections(None, window, cx, |s| {s.move_with(|map, selection| {@@ -100,6 +101,7 @@ impl Vim {selection.collapse_to(anchor.to_display_point(map), SelectionGoal::None);});});+ editor.set_clip_at_line_ends(true, cx);});});}@@ -306,4 +308,13 @@ mod test {cx.simulate_shared_keystrokes("g shift-u $").await;cx.shared_state().await.assert_eq("ˇABC DEF");}++ #[gpui::test]+ async fn test_change_case_motion_object(cx: &mut gpui::TestAppContext) {+ let mut cx = NeovimBackedTestContext::new(cx).await;++ cx.set_shared_state("abc dˇef\n").await;+ cx.simulate_shared_keystrokes("g shift-u i w").await;+ cx.shared_state().await.assert_eq("abc ˇDEF\n");+ }}diff --git a/crates/vim/test_data/test_change_case_motion_object.json b/crates/vim/test_data/test_change_case_motion_object.jsonnew file mode 100644index 00000000000..b2157975bd6--- /dev/null+++ b/crates/vim/test_data/test_change_case_motion_object.json@@ -0,0 +1,6 @@+{"Put":{"state":"abc dˇef\n"}}+{"Key":"g"}+{"Key":"shift-u"}+{"Key":"i"}+{"Key":"w"}+{"Get":{"state":"abc ˇDEF\n","mode":"Normal"}}