Bug 81776 - Java text editor doesn't follow Displayed tab width
Summary: Java text editor doesn't follow Displayed tab width
Status: RESOLVED DUPLICATE of bug 73104
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Tom Hofmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-22 05:35 EST by Ulrik Restorp CLA
Modified: 2005-01-18 03:11 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrik Restorp CLA 2004-12-22 05:35:43 EST
In 3.1M4 I set "General-Editors-All Text Editors-Displayed tab width" to 8.
Under "Java-Code Style-Formatter-Indentation-General settings" i set Tab size to
4, using spaces. In version 3.0.1 I had the opportunity to set "Displayed tab
width" to 8 under "Java-Editor-Appearance", but in 3.1M4 this seems to be
removed, and what is worse, the "Displayed tab width" setting from the "All Text
Editors" doesn't seem to be used. To change all tabs to 8 spaces is not an
option, as a huge diff would be the result (we have some 3-4000 .java files in
the project).

The Java editor should use the "General-Editors-All Text Editors-Displayed tab
width" setting. As it is now, the code looks completely messed up and the 3.1M4
is impossible to use (but we need it for Java 1.5).
Comment 1 Dani Megert CLA 2004-12-22 05:50:27 EST
>Under "Java-Code Style-Formatter-Indentation-General settings" i set Tab size to
>4, using spaces.
Why don't you set it to 8 then?

Tom please comment.
Comment 2 Ulrik Restorp CLA 2004-12-22 06:08:59 EST
Because one indentation level is 4 spaces. A tab is two indentations (4 spaces
each). Setting Java-Code Style-Formatter-Indentation-General settings-Tab size"
to 8 will make all indentations one level too deep.
Comment 3 Tom Hofmann CLA 2004-12-22 06:23:04 EST
Tempted to close as dup of bug 73104 - eclipse simply does not currently (and
never did) support mixed indentations. I wonder how the setup worked out for you
before, as you were not able to use the formatter nor auto-indent.
Comment 4 Ulrik Restorp CLA 2004-12-22 07:40:33 EST
It worked perfectly fine, both auto-indent and formatting was OK! I really hope
you can find a way to make it work as before, or we'll have a bad problem here.
Comment 5 Per Bothner CLA 2005-01-03 18:00:40 EST
In 3.0 at least you had the option of 8-column "display tab width" so you could
view existing files, plus you could set the formatter indent width to 4, as long
you told the formatter to not use tabs.  Thus you had to option to
*incrementally* migrate to using the Eclipse formatter, without tabs.

I was set to go this approach, but I clearly can't use 3.1M4, since it gives me
the unappealing choice of either having all my existing files unreadable, or not
being able to re-format.

Tom Eicher wrote: "eclipse simply does not currently (and never did) support
mixed indentations".  Right, but I hoped in bug 73104 I explained why it is
important to fix this.  It seems trivial: de-couple the display width and the
indentation width configuration parameters; when formatting a line, calculate
the indentation, and then (if using tabs) represent an indentation of I columns
by (I/T) tabs followed by (I%T) spaces. where T is the display tab width.
Comment 6 Ulrik Restorp CLA 2005-01-18 03:11:08 EST
The solution of bug 73104 will solve this one.

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