Bug 80348 - [typing][preferences] Code layout should support smart mixture of tabs and spaces
Summary: [typing][preferences] Code layout should support smart mixture of tabs and sp...
Status: RESOLVED DUPLICATE of bug 49896
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-07 04:52 EST by Thomas Singer CLA
Modified: 2004-12-07 06:06 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2004-12-07 04:52:50 EST
Some people like to look at the source code with an indentation of 4, others
prefer 2 (or whatever). This cannot be enforced with using spaces only or with
using "dumb" tabs. But there is a solution. Take this example (. is a space, ->
a tab-character):

with two spaces per tab:

->public void test(Foo foo,
->.................Bar bar) {
->->doSomething(bar, foo);
->}

the same code with 4 spaces per tab also looks good:

--->public void test(Foo foo,
--->.................Bar bar) {
--->--->doSomething(bar, foo);
--->}

These are the rules:
- use tabs only for the left-most indentation,
- for wrapped lines further indent using spaces,
- there must not be a tab character right beside a non-tab-character
Comment 1 Dani Megert CLA 2004-12-07 05:14:00 EST
See also bug 77464.
Comment 2 Thomas Singer CLA 2004-12-07 05:27:30 EST
> See also bug 77464.

I don't see, how these issues are related.
Comment 3 Dani Megert CLA 2004-12-07 05:37:26 EST
Not directly related but just a hint for the developer to also look at that bug
report: currently the out-of-the box formatter preference is to use spaces while
the editor uses tabs.
Comment 4 Tom Hofmann CLA 2004-12-07 05:48:41 EST

*** This bug has been marked as a duplicate of 49896 ***
Comment 5 Tom Hofmann CLA 2004-12-07 06:06:42 EST
after discussion with Dani:
- the problem is the same as described in bug 49896
- the typing smartness on our side also does not handle the case correctly
-> this has been fixed for M4