1

Our Java code style has a maximum line width for comments of 255. While I'm fine with this value (I hate when automatic formatting wraps comments), I sometimes want to (hard) wrap a paragraph manually to improve readability (like the Emacs fill-paragraph command does):

Is there a plugin that allows to wrap a line with a specified max width, e.g. 72, similar to what Ctrl+Shift+F does with the maximum line width for comments (in my case 255)?

Note: I'm not looking for soft wrap as covered by question Eclipse: Automatic line wrapping to specified width.

Community
  • 1
  • 1
pesche
  • 3,054
  • 4
  • 34
  • 35

1 Answers1

1

There ain't such a plugin, as eclipse will always reformat your specific wrapped code again with CTRL-SHIFT-F.

Though at least you are able to prevent Eclipse from formatting your code & comments with a special comment: @formatter.

// @formatter:off

... 

// @formatter:on
Big Bad Baerni
  • 996
  • 7
  • 21
  • We have now deactivated comment formatting altogether, to prevent destroying hard wrapped comments. There seems to be a bug with the 'never join line' option when there are `

    `s in the javadoc comment...

    – pesche Feb 26 '14 at 13:46