Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

"Lone" else lines are not properly indented #73

Description

@yohannd1

By "lone" else lines, I mean lines in if statements that only have whitespace and the else keyword. They're usually around when there is a multi-line if condition that isn't directly made up of blocks.

For an actual example on what is happening - I typed this code from top to bottom using automatic indentation:

const a = if (cond)
    val1
    else
    val2;

pub fn main() void {
    const b = if (cond)
        val1
        else
            val2;
}

What I expect to happen is the following:

const a = if (cond)
    val1
else
    val2;

pub fn main() void {
    const b = if (cond)
        val1
    else
        val2;
}

NOTE: I was previously working on this under the #59 PR, but got stuck and don't really know where to go anymore, so I'm leaving it up for anyone who may be able to tackle this in a better way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions