Stop eclipse from line wrapping?

前端 未结 4 620
花落未央
花落未央 2020-12-13 13:46

Is there a way to get eclipse to stop erasing existing line breaks? If I have a method signature like this, I can\'t figure out how to get eclipse to leave it alone:

<
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 14:17

    The formatting of arguments is an old subject, but the one new formatting feature introduced in 3.5 is:

    • eclipse3.5M4 "Formatter option to preserve user line breaks"

    The Java code formatter can now optionally preserve user line breaks by not joining lines in code or comments.

    For example, the wrapped lines of the return statement in following test case:

    before
    Example of Code to Format

    will be preserved by the formatter when the "Never Join Lines" preference is used, and now produces the following result:

    after
    Coded Formatted with Never Join Lines

    This preference can be configured on the Java > Code Style > Formatter preference page. See the Never join lines option on the Line Wrapping and Comments tab.

    That may help, but otherwise there is not much new features on that front in 3.5.

提交回复
热议问题