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.

Merge branch 'main' into pixel-columns

Conrad Irwin9d07561d99c3
diff --cc crates/vim/src/test.rs
index 3c486792121,34b9e387686..4fb87e70a0e
--- a/crates/vim/src/test.rs
+++ b/crates/vim/src/test.rs
@@@ -653,59 -653,27 +653,84 @@@ async fn test_selection_goal(cx: &mut g
.await;
}
+#[gpui::test]
+async fn test_wrapped_motions(cx: &mut gpui::TestAppContext) {
+ let mut cx = NeovimBackedTestContext::new(cx).await;
+
+ cx.set_shared_wrap(12).await;
+
+ cx.set_shared_state(indoc! {"
+ aaˇaa
+ 😃😃"
+ })
+ .await;
+ cx.simulate_shared_keystrokes(["j"]).await;
+ cx.assert_shared_state(indoc! {"
+ aaaa
+ 😃ˇ😃"
+ })
+ .await;
+
+ cx.set_shared_state(indoc! {"
+ 123456789012aaˇaa
+ 123456789012😃😃"
+ })
+ .await;
+ cx.simulate_shared_keystrokes(["j"]).await;
+ cx.assert_shared_state(indoc! {"
+ 123456789012aaaa
+ 123456789012😃ˇ😃"
+ })
+ .await;
+
+ cx.set_shared_state(indoc! {"
+ 123456789012aaˇaa
+ 123456789012😃😃"
+ })
+ .await;
+ cx.simulate_shared_keystrokes(["j"]).await;
+ cx.assert_shared_state(indoc! {"
+ 123456789012aaaa
+ 123456789012😃ˇ😃"
+ })
+ .await;
+
+ cx.set_shared_state(indoc! {"
+ 123456789012aaaaˇaaaaaaaa123456789012
+ wow
+ 123456789012😃😃😃😃😃😃123456789012"
+ })
+ .await;
+ cx.simulate_shared_keystrokes(["j", "j"]).await;
+ cx.assert_shared_state(indoc! {"
+ 123456789012aaaaaaaaaaaa123456789012
+ wow
+ 123456789012😃😃ˇ😃😃😃😃123456789012"
+ })
+ .await;
+}
++
+ #[gpui::test]
+ async fn test_paragraphs_dont_wrap(cx: &mut gpui::TestAppContext) {
+ let mut cx = NeovimBackedTestContext::new(cx).await;
+
+ cx.set_shared_state(indoc! {"
+ one
+ ˇ
+ two"})
+ .await;
+
+ cx.simulate_shared_keystrokes(["}", "}"]).await;
+ cx.assert_shared_state(indoc! {"
+ one
+
+ twˇo"})
+ .await;
+
+ cx.simulate_shared_keystrokes(["{", "{", "{"]).await;
+ cx.assert_shared_state(indoc! {"
+ ˇone
+
+ two"})
+ .await;
+ }