ZIm/crates/languages/src/python
Ben Kunkle e273de5490
python: Fix incorrect indenting of except, finally, else, and elif control flow (#27428)
Closes #10832

Note: This PR only fixes the issue where when entering one of `except`,
`finally`, `else`, and `elif` after another block like so:

```python
try:
    for i in range(n):
        pass
except:|
```

The `except` would be indented resulting in the following:

```python
try:
    for i in range(n):
        pass
    except:|
```

This PR does not fix a separate issue in which the indentation is not
corrected from the second example to the first, i.e. if example 2 is
typed verbatim in Zed it will not auto-indent to look like example 1.
Handling of this case would likely require specific logic to handle, or
changes to the tree-sitter grammar for Python, as the current grammar
results in ERROR nodes that obscure the natural structure (cannot tie
the `except` to the `try`)

Release Notes:

- Fixed an issue where `except`, `finally`, `else`, and `elif` control
flow keywords in Python would be incorrectly indented when entered at
the correct level of indentation.
2025-03-25 14:58:41 +00:00
..
brackets.scm vim: Update anyquotes and anybrackets to behave like mini.ai plugin (#24167) 2025-02-17 14:55:48 -07:00
config.toml Do not indent on enter in python comments ending in colon (#25437) 2025-02-24 04:11:22 +00:00
embedding.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
highlights.scm python: Fix and improve highlighting (#25813) 2025-03-04 08:41:10 +01:00
indents.scm python: Fix incorrect indenting of except, finally, else, and elif control flow (#27428) 2025-03-25 14:58:41 +00:00
outline.scm assistant: Add annotations to more languages (#15866) 2024-08-07 13:47:21 +02:00
overrides.scm Add inclusive range scope overrides. Don't auto-close quotes at the ends of line comments (#20206) 2024-11-04 15:36:39 -08:00
runnables.scm python: Fix decorated test detection (#22327) 2024-12-21 13:11:52 +00:00
textobjects.scm Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00