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

Auto Format: Switch block cases not indented #1042

Closed
processing-bugs opened this issue Feb 10, 2013 · 4 comments
Closed

Auto Format: Switch block cases not indented #1042

processing-bugs opened this issue Feb 10, 2013 · 4 comments
Labels

Comments

@processing-bugs
Copy link

Original author: mkmori...@gmail.com (February 25, 2012 06:06:09)

Auto Format does not seem to indent case labels inside a switch block as in the examples:

http://processing.org/reference/switch_.html

(Auto Format does indent statements inside a case block.) (1.5.1)

FWIW!

Original issue: http://code.google.com/p/processing/issues/detail?id=1004

@ShreyK
Copy link

ShreyK commented May 14, 2014

As can be seen in the image below the indenting after Auto Format is... well :(

untitled

Anyone know the reason why this happens?

@AmnonOwed
Copy link
Contributor

Seems like this issue is fixed. Running several tests with the switch auto-formatting (in 2.2.1.) and they all produce the expected result. Some example incorrectly formatted code below. After running auto-format on it, it's indented properly. So I think this issue can be closed.

Test Code

void mousePressed() {
  int randomInt = int(random(10));

  switch(randomInt) {
case 1: break;
           case 2: break;
  case 3:
  background(255);
  break;
 case 4:
         background(0);
                                break;  
  }
}

@benfry
Copy link
Contributor

benfry commented Aug 1, 2014

Thanks for checking. There were a couple commits and then some things backed out, but glad to hear this one is at least working properly.

@benfry benfry closed this as completed Aug 1, 2014
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants