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

Nested if statements not displayed correctly #450

Closed
Timwi opened this issue Apr 18, 2014 · 3 comments
Closed

Nested if statements not displayed correctly #450

Timwi opened this issue Apr 18, 2014 · 3 comments

Comments

@Timwi
Copy link

Timwi commented Apr 18, 2014

Input:

if(X)if(Y)a();else b();else c();

Actual output:

if (X)
    if (Y) a();
    else b();
    else c();

Expected output:

if (X)
    if (Y) a();
    else b();
else c();
@bitwiseman
Copy link
Member

Actually, this is by design. We don't enforce the newline between if/else and their child statements. If you include the newline, we will preserve it, but for every person like you that wants it this way, there's another that wants it the other way. Sorry.

Leaving this open as a possible future enhancement.

@bitwiseman bitwiseman added this to the Future milestone Apr 21, 2014
@Timwi
Copy link
Author

Timwi commented Apr 22, 2014

@bitwiseman You have not addressed the reported bug. I’ve edited the bugreport to remove the extra newline for the child statements. The indentation of the second else is still wrong.

@bitwiseman
Copy link
Member

Ah I see. Okay.

@bitwiseman bitwiseman modified the milestones: v1.5.0, Future Apr 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants