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
..
2025-03-19 02:09:02 +00:00
2025-03-21 12:29:07 +00:00
2025-03-21 10:04:39 -06:00
2025-03-24 21:00:33 -03:00
2025-03-25 12:44:44 +00:00
2025-03-24 19:32:52 +01:00
2025-03-21 16:39:01 +00:00
2025-03-22 00:05:34 -04:00
2025-03-19 02:09:02 +00:00
2025-03-24 15:58:07 -04:00
2025-03-25 10:56:41 -04:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-24 19:25:56 +00:00
2025-03-21 00:10:17 -04:00
2025-03-19 02:09:02 +00:00
2025-03-22 02:56:25 +00:00
2025-03-19 02:09:02 +00:00
2025-03-22 19:23:11 +00:00
2025-03-25 04:35:01 +05:30
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-22 00:05:34 -04:00
2025-03-25 10:56:27 +01:00
2025-03-19 02:09:02 +00:00
2025-03-25 00:21:09 +00:00
2025-03-19 02:09:02 +00:00
2025-03-25 00:36:09 +01:00
2025-03-19 02:09:02 +00:00
2025-03-25 09:22:01 -03:00
2025-03-24 21:00:21 -03:00
2025-03-19 02:09:02 +00:00
2025-03-25 18:23:59 +05:30
2025-03-25 18:23:59 +05:30
2025-03-25 18:23:59 +05:30
2025-03-22 18:38:01 +05:30
2025-03-19 12:20:26 +00:00
2025-03-22 02:56:25 +00:00
2025-03-18 22:19:11 -06:00
2025-03-24 19:25:56 +00:00
2025-03-24 19:03:57 +00:00
2025-03-17 15:39:52 +00:00
2025-03-25 07:05:25 +00:00
2025-03-19 02:09:02 +00:00
2025-03-24 16:29:18 +00:00
2025-03-14 13:40:02 -03:00
2025-03-17 02:36:37 +00:00
2025-03-17 02:36:37 +00:00
2025-03-19 02:09:02 +00:00
2025-03-24 20:45:06 -07:00
2025-03-19 02:09:02 +00:00
2025-03-25 15:13:53 +02:00
2025-03-25 18:23:59 +05:30
2025-03-21 12:29:07 +00:00
2025-03-20 10:22:49 -03:00
2025-03-25 10:56:27 +01:00
2025-03-19 02:09:02 +00:00
2025-03-21 09:15:41 +02:00
2025-03-25 14:58:41 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-22 19:23:11 +00:00
2025-03-19 02:09:02 +00:00
2025-03-24 13:57:06 +01:00
2025-03-25 04:35:01 +05:30
2025-03-24 16:12:26 -06:00
2025-03-19 02:09:02 +00:00
2025-03-14 07:19:43 +00:00
2025-03-21 00:10:17 -04:00
2025-03-18 18:18:56 +00:00
2025-03-20 13:06:10 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-25 15:13:53 +02:00
2025-03-21 00:10:17 -04:00
2025-03-22 19:23:11 +00:00
2025-03-19 02:09:02 +00:00
2025-03-20 08:30:04 +00:00
2025-03-21 12:29:07 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-22 19:23:11 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-18 17:59:58 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-20 13:06:10 +00:00
2025-03-19 02:09:02 +00:00
2025-03-19 02:09:02 +00:00
2025-03-18 12:55:25 -04:00
2025-03-19 02:09:02 +00:00
2025-03-13 10:41:04 -07:00
2025-03-19 02:09:02 +00:00
2025-03-24 22:31:11 -07:00
2025-03-19 02:09:02 +00:00
2025-03-18 20:39:54 +00:00
2025-03-24 22:31:11 -07:00
2025-03-21 12:04:59 +02:00
2025-03-19 15:33:08 +01:00
2025-03-19 18:48:35 +00:00
2025-03-19 17:26:46 +00:00
2025-03-25 08:20:50 -03:00
2025-03-19 02:09:02 +00:00
2025-03-25 12:44:44 +00:00
2025-03-18 22:27:09 -06:00
2025-03-24 22:31:11 -07:00
2025-03-15 14:16:10 +08:00
2025-03-22 19:23:11 +00:00
2025-03-19 17:26:46 +00:00
2025-03-25 07:05:25 +00:00
2025-03-21 00:10:17 -04:00
2025-03-25 07:05:25 +00:00
2025-03-24 21:00:33 -03:00
2025-03-25 07:05:25 +00:00
2025-03-25 03:05:32 +00:00
2025-03-21 20:08:03 +00:00