Rasto
Rasto

Reputation: 17844

Set Eclipse not to insert blank lines between methods declaration in interfaces?

I'm having trouble to set up formatter not to insert blank lines between methods in interfaces. In the same time I still want to have blank lines between methods in classes. I cannot find appropriate formatter setting that would allow this. Can somebody point me to the right option?

Upvotes: 9

Views: 1644

Answers (1)

mtk
mtk

Reputation: 13717

As stated in comments by vainolo, there isn't any direct option to do so. Following is the screenshot for the eclipse formatter for adding new lines and it doesn't distinguish between the methods of class and interface eclipse formatter- black lines

Workaround

But, a simple manual work-around is possible. Select the lines as shown below, and run a simple regex ^\s*\n find and replace to remove the blank lines.

work around

Hope this helps.

Upvotes: 6

Related Questions