Skip to content

Keep scope braces next to loop braces with static foreach #607

Description

@0xEAB

static foreach does not introduce a new scope on its own; instead one has to add a nested set of braces.
Currently, dfmt splits them which wastes a good amount of screen space and might look a bit odd.

Current format

static foreach (item; items)
{
	{
		// code here
	}
}
static foreach (item; items) {
	{
		// code here
	}
}

Idea

I’d prefer to have the scope braces right next to the loop braces.

static foreach (item; items)
{{
	// code here
}}
static foreach (item; items) {{
	// code here
}}

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions