Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: Set maximum line length for auto formatting right?

I make all according this question: Eclipse: Set maximum line length for auto formatting?.

my result: enter image description here

I tryed to make own profile. profile was created:

enter image description here

before ctrl+shift+f : enter image description here

after:

enter image description here

How to fix it?

like image 601
gstackoverflow Avatar asked Jan 20 '14 07:01

gstackoverflow


People also ask

How do I set the maximum line length in Eclipse?

To set the maximum line length in Eclipse, open Eclipse and in the menu bar, go to Window -> Preferences and in the pop-up window, go to Java -> Code Style -> Formatter. This will open up the Formatter options in the right window pane. Click on the Edit button to modify the current formatter profile.

How do I set up Lineline length formatter?

Line length formatter setup is blocked for annotations (Eclipse Photon checked). Therefore it is needed in Line Wrapping -> Wrapping settings -> Annotations. Setup line wrapping as appropriate for you.

How to increase/decrease the line length in the editor?

Field: "Maximum line width", Set the desired value (Default value set to 120) to increase/decrease the line length in the editor. Note: Remember to rename the Active profile to the name of your choice, as the default Eclipse profile won't accept your changes.

How to change the width of the line in formatter profile?

In the formatter profile pop-up window, click on the Line Wrapping tab. The width of the line can be set in field, Maximum line width. Changing any of the [built-in] profiles requires to save the changes as a custom profile.


2 Answers

Goto How to Change the Default Format Settings in Eclipse

Follow the steps to create a new profile. Step 11 [Line Wrapping] shows a 'Maximum line width' field, changing that would fix your issue.

Also, make sure your newly created profile is selected in the Active Profile drop-down inside Window -> Preferences -> Java -> Code Style -> Formatter.

If you are trying to format XML: Goto Window -> Preferences -> XML -> XML Files -> Editor and change Line width field.

like image 80
Asif Arshad Avatar answered Oct 01 '22 21:10

Asif Arshad


right answer: enter image description here

P.S. thanks Jon Skeet

like image 36
gstackoverflow Avatar answered Oct 01 '22 20:10

gstackoverflow