Insane
Insane

Reputation: 889

Prevent IntelliJ from removing newlines around single statement methods?

Sometimes IntelliJ will take single statement methods and put them on the same line, as seen here:

If I click either bracket it will turn back into:

This question isn't a debate for which of the two is better - I want to know how to turn this off. I combed through IntelliJ preferences and couldn't seem to find anything, and searching both here and Google didn't bring up what I wanted.

Upvotes: 4

Views: 147

Answers (2)

Phasmid
Phasmid

Reputation: 953

If you're talking about code reformatting putting the extra newlines into your code, then it's the "Simple methods in one line" option you want to check in Editor/Code Style/Scala/Wrapping and Braces: enter image description here

Upvotes: -1

Hugo G
Hugo G

Reputation: 16536

I think these options are responsible for this: enter image description here

Upvotes: 6

Related Questions