Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python incorrect auto-indentation for except: #10832

Open
tidely opened this issue Apr 22, 2024 · 3 comments
Open

Python incorrect auto-indentation for except: #10832

tidely opened this issue Apr 22, 2024 · 3 comments
Labels
python Python programming language support reproducible Verified steps to reproduce included

Comments

@tidely
Copy link
Contributor

tidely commented Apr 22, 2024

Summary: Zed incorrectly auto indents except and finally blocks when the block contains a for loop.

Description

Steps to reproduce:

  1. Create a new file and save a something.py
try:
    for i in range(1):
        pass
  1. type except at beginning of the next line.
  2. type :

Actual behavior:

try:
    for i in range(1):
        pass
    except:

Expected behavior:

try:
    for i in range(1):
        pass
except:

Environment

Zed: v0.131.6 (Zed)
OS: macOS 14.4.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

video
Screen.Recording.2024-04-22.at.9.41.27.mov
@tidely tidely added admin read bug [core label] labels Apr 22, 2024
@tidely tidely changed the title Python incorrect auto-indenatation Python incorrect auto-indentation Apr 22, 2024
@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc python Python programming language support language An umbrella label for all programming languages syntax behaviors and removed triage labels Apr 22, 2024
@github-actions github-actions bot added the stale Label used by `stale` action label Oct 22, 2024
@tidely
Copy link
Contributor Author

tidely commented Oct 28, 2024

Yes, this issue still persists

@notpeter
Copy link
Member

notpeter commented Feb 26, 2025

Update: Saw your video. I can reproduce with Zed 0.176.0.
Added steps to the description.

@notpeter notpeter added needs-repro Needs reproduction steps / someone to reproduce and removed editor Feedback for code editing, formatting, editor iterations, etc language An umbrella label for all programming languages syntax behaviors bug [core label] labels Feb 26, 2025
@zed-industries zed-industries deleted a comment from github-actions bot Feb 26, 2025
@notpeter notpeter removed the needs-repro Needs reproduction steps / someone to reproduce label Feb 26, 2025
@notpeter notpeter added the reproducible Verified steps to reproduce included label Feb 26, 2025
@notpeter notpeter changed the title Python incorrect auto-indentation Python incorrect auto-indentation for except: Feb 26, 2025
@tidely
Copy link
Contributor Author

tidely commented Feb 26, 2025

The indentation issue isn't unique to except:, it also happens with else: and finally:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python programming language support reproducible Verified steps to reproduce included
Projects
None yet
Development

No branches or pull requests

3 participants