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

Shell Script: Pressing return at the end of a line that starts a block doesn't indent the next line to the new level #23628

Open
1 task done
danfuzz opened this issue Jan 24, 2025 · 0 comments
Labels
bash Bash scripting support bug [core label] language An umbrella label for all programming languages syntax behaviors

Comments

@danfuzz
Copy link

danfuzz commented Jan 24, 2025

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When editing in the "Shell Script" language, if you type something that starts a block (such as an if or function, etc.), when you press return on the line, the cursor ends up indented at the old level and not the level implied by what was just typed.

For example, if I type function foo { and then press return, I would expect to see the following, where | represents the insertion cursor:

function foo {
    |
}

but instead I end up with:

function foo {
|}

Similarly, if I'm in an indentation level in and type if (( x == 1 )); then and then press return, I expect:

function foo {
    if (( x == 1 )); then
        |
}

but instead I end up with:

function foo {
    if (( x == 1 )); then
    |
}

(Note: I'm using four spaces per indentation level here.)

Zed Version and System Specs

Zed: v0.170.2 (Zed)
OS: macOS 14.7.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add screenshots or screencasts of the incorrect state / behavior

No response

If applicable, attach your Zed.log file to this issue.

No response

@danfuzz danfuzz added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jan 24, 2025
@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors bash Bash scripting support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash Bash scripting support bug [core label] language An umbrella label for all programming languages syntax behaviors
Projects
None yet
Development

No branches or pull requests

2 participants