Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse keeps wrapping my lines even though I have taken measures to prevent this

I'm using windows 7 64 bit with 32 bit JDK 1.7, Eclipse Indigo

I have a wide screen and I think its hard to read functionality quickly from wrapped lines. I would like Eclipse to do the indentation correction for me but I dislike the wrapping functionality and would like to turn it off.

So here's what I have done:

Window>Preferences>Java>Code Style>Formatter:

created a profile with my name then clicked "Edit..." button.

"Line Wrapping" Tab I have the following:

Maximum line width: 200 Default indentation for wrapped lines: 2 Default indentation for array initializers: 2 Never join already wrapped lines: not checked Prefer wrapping outer expressions (keep nested expressions on one line): not checked

Every policy in the list that comes below is set to: Do not wrap.

When pressing Ctrl+Shift+F my lines are wrapped. The longest line I can find has 109 characters in it.

Can someone help me find what I have done wrong? Thanks!

like image 323
Alex Avatar asked Apr 30 '12 11:04

Alex


Video Answer


1 Answers

Check the following items:

  • Correct Profile is selected;
  • Comments has its own Line Width configuration;
  • A settings specific for project is overwriting the Workspace settings. (Project Properties > Java Code Style > Formatter)
like image 174
João Paulo G. Brandt Avatar answered Oct 04 '22 00:10

João Paulo G. Brandt