Bug 14151 - The code formatter does not respect the "maximum line length" property when the indentation is set to tabulation.
Summary: The code formatter does not respect the "maximum line length" property when t...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P5 trivial (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-18 15:21 EDT by Marc CLA
Modified: 2002-05-02 11:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc CLA 2002-04-18 15:21:15 EDT
The code formatter does not respect the "maximum line length" property when 
the indentation is set to tabulation.

To reproduce:

1. Go in "Workbench" / "Preferences" / "Java" / "Code formatter".
In the "Line splitting" item, set the "Maximum line length" property to 80.
In the "Style" item, check the "Indentation is represented by a tab" property 
and set the "Number of space representing a tab" property to 4.

2. Create a class with the following method:

public void mth1(String s1, String s2, String s3, String s4) throws Exception {
}

3. Right click on the editor and choose "Format".

4. The produced code pass thought of the vertical line delimitating the 
maximum line length.

5. Raison (I guess): the tabulation is interpreted as one character instead of 
4 (as we defined it on the first point).

Best regards,

Marc
Comment 1 Erich Gamma CLA 2002-04-23 05:32:22 EDT
moving to platform CORE
Comment 2 Olivier Thomann CLA 2002-04-30 11:22:47 EDT
I found the bug. A fix will be released after the today's build. Now even if the source code goes 
beyond the vertical line, it has the right size. The font used to display the keyword is in bold and 
this shifts the result to the right. So the line looks like it goes beyond the vertical line even if 
the number of characters is lower than the maximum number of characters for a single line.
Comment 3 Olivier Thomann CLA 2002-05-01 15:00:34 EDT
Fixed and released in HEAD.
Comment 4 Olivier Thomann CLA 2002-05-01 15:01:17 EDT
Fixed.