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

Indentation in multi-line, wrapped assignment #187

Closed
Gama11 opened this issue Aug 16, 2018 · 0 comments · Fixed by #248
Closed

Indentation in multi-line, wrapped assignment #187

Gama11 opened this issue Aug 16, 2018 · 0 comments · Fixed by #248
Labels
bug Something isn't working indentation Indentation is incorrect wrapping Incorrect or undesirable wrapping

Comments

@Gama11
Copy link
Member

Gama11 commented Aug 16, 2018

Apart from the awkward wrapping (see #169), indentation keeps increasing with each line here:

class Main
{
	public static function main()
	{
		dirty = dirty || (Tilemap.x != _prevTilemapX) || (Tilemap.y != _prevTilemapY) || (Tilemap.scale.x != _prevTilemapScaleX) || (Tilemap.scale
			.y != _prevTilemapScaleY) || (Tilemap.scrollFactor.x != _prevTilemapScrollX) || (Tilemap.scrollFactor.y != _prevTilemapScrollY) || (Camera.scroll
				.x != _prevCameraScrollX) || (Camera.scroll.y != _prevCameraScrollY) || (Camera.scaleX != _prevCameraScaleX) || (Camera
					.scaleY != _prevCameraScaleY) || (Camera.width != _prevCameraWidth) || (Camera.height != _prevCameraHeight);
	}
}

It seems like the indentation level should not be increased further after the second line?

class Main
{
	public static function main()
	{
		dirty = dirty || (Tilemap.x != _prevTilemapX) || (Tilemap.y != _prevTilemapY) || (Tilemap.scale.x != _prevTilemapScaleX) || (Tilemap.scale
			.y != _prevTilemapScaleY) || (Tilemap.scrollFactor.x != _prevTilemapScrollX) || (Tilemap.scrollFactor.y != _prevTilemapScrollY) || (Camera.scroll
			.x != _prevCameraScrollX) || (Camera.scroll.y != _prevCameraScrollY) || (Camera.scaleX != _prevCameraScaleX) || (Camera
			.scaleY != _prevCameraScaleY) || (Camera.width != _prevCameraWidth) || (Camera.height != _prevCameraHeight);
	}
}
@Gama11 Gama11 added the bug Something isn't working label Aug 16, 2018
@AlexHaxe AlexHaxe added indentation Indentation is incorrect wrapping Incorrect or undesirable wrapping labels Aug 17, 2018
AlexHaxe added a commit to AlexHaxe/haxe-formatter that referenced this issue Oct 22, 2018
fixed wrapping function calls, fixes HaxeCheckstyle#169
fixed conditional handling in multi-line object literals, fixes HaxeCheckstyle#182, fixes HaxeCheckstyle#211
fixed indentaion and wrapping of OpBool chain, fixes HaxeCheckstyle#187
AlexHaxe added a commit that referenced this issue Oct 22, 2018
* added OpBool chain support
* fixed wrapping function calls, fixes #169
* fixed conditional handling in multi-line object literals, fixes #182, fixes #211
* fixed indentaion and wrapping of OpBool chain, fixes #187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working indentation Indentation is incorrect wrapping Incorrect or undesirable wrapping
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants