Is there an Eclipse line-width marker?

后端 未结 3 1997
滥情空心
滥情空心 2020-12-07 10:30

I have a specific project where I need to wrap every code line at 65 characters. I have set up the eclipse Java code formatter properly for this. But what I really want is a

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 11:28

    Look in Windows / Preferences (at least on Windows - IIRC it moves around for different operating systems) then:

    General -> Editors -> Text Editors -> Show Print Margin
    

    Tick this and it should show the line.

    As a quick way of finding this, use the search filter in the top and filter on "margin".

    Notes from the comments - unverified by me, but I have no reason to doubt them:

    It has changed somehow in 2016: For details see [here] (https://bugs.eclipse.org/bugs/show_bug.cgi?id=495490#c2) You have to set it in the formatter: From menu [Window]-->[Preferences], select [Java]-->[Code Style]-->[Formatter], and then edit your formatter profile. In the tab page [Line wrapping], you can find a setting named "Maximum line width". Change this setting, and the print margin in Java source editor will be changed too.

提交回复
热议问题