Summary: | Java text editor doesn't follow Displayed tab width | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ulrik Restorp <ulrik.restorp> |
Component: | Text | Assignee: | Tom Hofmann <eclipse> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | major | ||
Priority: | P3 | CC: | daniel_megert |
Version: | 3.1 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Ulrik Restorp
2004-12-22 05:35:43 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.
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. 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. 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. 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. |