saw303
saw303

Reputation: 9072

How can I suppress the addition of a blank new line after the class declaration in IntelliJ? (Code Style)

I'm having the problem that IntelliJ Idea keeps adding a blank new line after the class statement. A class like the one below

public class A {
   private String name;
}

gets formatted into this one below.

public class A {

   private String name;
}

The following diff show the blank new line between the class statement and the first field declaration.

Diff

My code style settings on Wrapping and Braces tab are as follows:

Setting 1/3 Setting 2/3 Setting 3/3

I was not able to find a setting that suppresses this additional new line. Can anyone help me on this?

Upvotes: 4

Views: 2354

Answers (1)

JJF
JJF

Reputation: 2777

In settings: Editor|Code Style|Java on the 'Blank Lines' tab you probably have 'After class header' set to 1. Change this value to 0 and the unwanted blank line won't be added by the formatter.

Upvotes: 4

Related Questions