views:

26

answers:

1

How to setup IntelliJ IDEA to prevent splitting of anonymous class, declared by one line, into several lines during auto-reformating(CTRL+ALT+L)?

For example, to prevent splitting of

x = foo(new Boo() {});

into two lines:

x = foo(new Boo() {

});

+1  A: 
"Settings"/"Code Style"/"Alignment and Braces":
   ==>  "Keep when Reformatting" Field Set:
          Check: "Simple methods in one line"
          Check: "Simple blocks in one line"
Adrian A.
Unfortunatelly, it doesn't work as expected. Maybe class block is another kind of blocks, than statement blocks.
Eliah
Than that's a bug in the IntelliJ version you are using IMHO, since there's no other option than that in the Settings.
Adrian A.
I'm using the latest version. Well, I hope it will be fixed in future versions.Thank you, Adrian!
Eliah

related questions