editor: Add Python auto-indent test for same row bracket pair (#31473)
We [recently](https://github.com/zed-industries/zed/pull/31260) added a
condition which fixes certain edge cases detecting indent ranges when a
bracket pair is on the same row for suggested indent languages. This PR
adds a test for that so we don't regress in the future. Ref:
https://github.com/zed-industries/zed/issues/31362
f9592c6b92/crates/language/src/buffer.rs (L2910)
Release Notes:
- N/A
This commit is contained in:
parent
d211f88d23
commit
2a8242ac90
1 changed files with 13 additions and 0 deletions
|
@ -20836,6 +20836,19 @@ async fn test_outdent_after_input_for_python(cx: &mut TestAppContext) {
|
||||||
break
|
break
|
||||||
else:ˇ
|
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]
|
#[gpui::test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue