Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA wrapping settings for one-line anonymous class

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

For example, to prevent the splitting of

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

into two lines:

x = foo(new Boo() {

});
like image 429
Ilya Lakhin Avatar asked Dec 28 '22 09:12

Ilya Lakhin


1 Answers

"File" [menu]/"Settings"/"Code Style"/"Alignment and Braces":
   ==>  "Keep when Reformatting" Field Set:
          Check: "Simple methods in one line"
          Check: "Simple blocks in one line"
like image 106
Adrian A. Avatar answered Jan 04 '23 15:01

Adrian A.