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

feature request: don't insert empty lines after import statements within function bodies #581

Open
Moth-Tolias opened this issue Jun 20, 2023 · 3 comments

Comments

@Moth-Tolias
Copy link

it would be nice if there was an option to not insert empty lines after import statements within function bodies.
for example:

void resizeRoom(in size_t roomIndex, in Vector2!Sign direction) @nogc nothrow pure @safe
{
	auto room = rooms[roomIndex];

	import std.algorithm: clamp; //this import is "associated" with the following lines
	room.w = cast(ubyte) clamp(room.w + direction.x, 0, Room.maxSize.x);
	room.h = cast(ubyte) clamp(room.h + direction.y, 0, Room.maxSize.y);
	clampRoom(room);

	rooms[roomIndex] = room;
}
@baryluk
Copy link

baryluk commented Dec 18, 2023

I like having empty line before import. Having an option maybe.

What I would want tho, is ability to also add empty line AFTER group of imports:

int f() {
  int a = 6;

  import std.stdio;
  import std.range;
  import std.array;

  int b = a + 5;
  return b;
}

@Moth-Tolias
Copy link
Author

Moth-Tolias commented Dec 18, 2023

I like having empty line before import. Having an option maybe.

What I would want tho, is ability to also add empty line AFTER group of imports:

...did you get before and after mixed up?

@baryluk
Copy link

baryluk commented Dec 18, 2023

I like having empty line before import. Having an option maybe.
What I would want tho, is ability to also add empty line AFTER group of imports:

...did you get before and after mixed up?

I did not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants