# language: Fix indent suggestions for significant indented languages like Python \(\#29625\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7c76cee16d4818c8695ff364d901ed0739fd583b

Requested commit: 7c76cee16d4818c8695ff364d901ed0739fd583b

Commit: 7c76cee16d4818c8695ff364d901ed0739fd583b

Tree: f9579aac47a06a3351b5393290d5b96b3c29eb71

Author: Smit Barmase

Committer: GitHub

## Message

```
language: Fix indent suggestions for significant indented languages like Python (#29625)

Closes #26157

This fixes multiple cases where Python indentation breaks:
- [x] Adding a new line after `if`, `try`, etc. correctly indents in
that scope
- [x] Multi-cursor tabs correctly preserve relative indents
- [x] Adding a new line after `else`, `finally`, etc. correctly outdents
them
- [x] Existing Tests

Future Todo: I need to add new tests for all the above cases.

Before/After:

1. Multi-cursor tabs correctly preserve relative indents


https://github.com/user-attachments/assets/08a46ddf-5371-4e26-ae7d-f8aa0b31c4a2

2. Adding a new line after `if`, `try`, etc. correctly indents in that
scope


https://github.com/user-attachments/assets/9affae97-1a50-43c9-9e9f-c1ea3a747813

Release Notes:

- Fixes indentation-related issues involving tab, newline, etc for
Python.
```

## Parents

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

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