14

Intellij keeps formatting my switch case as follows:

 switch (enumVal) { case X: //do stuff break; case Y: //do stuff break; } 

But I would like it to be formatted like Sun style:

 switch (enumVal) { case X: //do stuff break; case Y: //do stuff break; } 

Is there a way to config that?

1 Answer 1

21

Go to Settings > Editor > Code Style > Java, select tab "Wrapping and Braces", scroll down the list to 'switch' statement, uncheck the option "Indent 'case' branches".

More information: IntelliJ 2016.3 Help - Code Style, Java

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.