Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically remove unneeded line breaks in Intellij Idea's code cleanup

I just started using IntelliJ IDEA and went through the automatic code clean-up options. It gives me the option to remove unneeded white lines, but I can't find an option to automatically remove unneeded break for example here:

System.out.println("this, sir " + "is an unneeded line break");

Does this feature exist, if yes, where?

like image 377
Yorrd Avatar asked Mar 13 '14 23:03

Yorrd


1 Answers

Under Preferences -> Code Style -> Java -> Wrapping and Braces there is an option called Keep when reformatting with a checkbox for Line breaks.

If you uncheck it IDEA will do what you want.

like image 60
Andreas Wederbrand Avatar answered Oct 29 '22 06:10

Andreas Wederbrand