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.

editor: Add Python auto-indent test for same row bracket pair (#31473)

Smit Barmase2a8242ac909f
diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs
index a3508b247ae..04d031d1c0d 100644
--- a/crates/editor/src/editor_tests.rs
+++ b/crates/editor/src/editor_tests.rs
@@ -20836,6 +20836,19 @@ async fn test_outdent_after_input_for_python(cx: &mut TestAppContext) {
break
else:ˇ
"});
+
+ // test does not outdent on typing after line with square brackets
+ cx.set_state(indoc! {"
+ def f() -> list[str]:
+ ˇ
+ "});
+ cx.update_editor(|editor, window, cx| {
+ editor.handle_input("a", window, cx);
+ });
+ cx.assert_editor_state(indoc! {"
+ def f() -> list[str]:
+ aˇ
+ "});
}
#[gpui::test]