# language: Improve auto-indentation when using round brackets in Python \(\#31260\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4c28d2c2e26e64cb9b4131a39e23e0265c7263f7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4c28d2c2e26e64cb9b4131a39e23e0265c7263f7

Requested commit: 4c28d2c2e26e64cb9b4131a39e23e0265c7263f7

Commit: 4c28d2c2e26e64cb9b4131a39e23e0265c7263f7

Tree: 25ae40b8530fe94f6b26fb8bdb69ceee499c84b7

Author: Finn Evers

Committer: GitHub

## Message

````
language: Improve auto-indentation when using round brackets in Python (#31260)

Follow-up to #29625 and #30902

This PR reintroduces auto-intents for brackets in Python and fixes some
cases where an indentation would be triggered if it should not. For
example, upon typing

```python
a = []
```
and inserting a newline after, the next line would be indented although
it shoud not be.

Bracket auto-indentation was tested prior to #29625 but removed there
and the test updated accordingly. #30902 reintroduced this for all
brackets but `()`. I reintroduced this here, reverted the changes to the
test so that indents also happen after typing `()`. This is frequently
used for tuples and multiline statements in Python.

Release Notes:

- Improved auto-indentation when using round brackets in Python.
````

## Parents

- [a204510cfca224475e1e50e87a9391e0d244eef8](https://git.cafe/gitcafe/zed/commit/a204510cfca224475e1e50e87a9391e0d244eef8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4c28d2c2e26e64cb9b4131a39e23e0265c7263f7?format=markdown)
