Bug 495490 - Print margin not respected in Java editor
Summary: Print margin not respected in Java editor
Status: CLOSED DUPLICATE of bug 468307
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-05 13:47 EDT by Ulrich Hobelmann CLA
Modified: 2016-07-06 06:55 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Hobelmann CLA 2016-06-05 13:47:58 EDT
This seems to be a regression in the 4.6 Neon release. In Mars it used to work, AFAIK.

The JDT java editor ignores the set print margin. Instead it shows the print margin at an arbitrary column (120?).

Admittedly, in the preferences there is a new description text "Some editors may not honor all of these settings", but
* that's not really the point of settings
* it used to work in 4.5
* shouldn't all Eclipse UI editors share a common codebase for common stuff like this?
Comment 1 Simon Archer CLA 2016-06-28 16:08:44 EDT
I have observed this too. The text editor print margin has been respected by the Java editor for as long as I can remember, and I've used Eclipse since before 1.0.

This is absolutely a regression since Mars. If the Java editor no longer supports the print margin preference it should no long render a print margin. 

The print margin in the Java editor is indeed permanently set at column 120.
Comment 2 Ying Li CLA 2016-07-05 21:26:20 EDT
>>   Instead it shows the print margin at an arbitrary column (120?)

Hi, I did a little research, and found out that:

It is not an arbitrary column,
it is the setting from your java source code 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.

So, looks like it is not a regression.
Java source editor is using the "Maximum line width" setting from the java source code formatter profile setting, instead of the common print margin setting.
Comment 3 Manuel Steurer CLA 2016-07-06 06:47:44 EDT
Probably a duplicate of 468307
Comment 4 Andrey Loskutov CLA 2016-07-06 06:55:01 EDT
(In reply to Manuel Steurer from comment #3)
> Probably a duplicate of 468307

yep.

*** This bug has been marked as a duplicate of bug 468307 ***