Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 78257

Summary: Using spaces for tabs; New line indent is wrong.
Product: [Eclipse Project] JDT Reporter: bw <bw456>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description bw CLA 2004-11-09 23:30:14 EST
I found this bug in 3.0.1, after deleting my .metadata directory and restarting 
Eclipse.  I turned on "use spaces for tabs".  I then create a new Class file.  
I go into the body of the class, and hit enter.  My cursor is indented to the 4 
space. I type the constructor, ie: "public MyClass() {".  When I hit return, 
the cursor is on the 5 position. (It should be on the 8 position.)  
From this point, there are 3 odd behaviours:
1) If I hit the HOME key, my cursor jumps to the 8th position, with spaces in 
position 4-8.  This also happens if I hit the END key twice.
2) However, if I hit tab key (instead of doing (1) above), I jump to the 8th 
position, but there is a tab character on the page, instead of spaces.
3) Next, I decide to delete the body of my constructor, leaving only "public 
MyClass() {" on the first line, and "}" on the second line.  I put my cursor at 
the end of the first line, and hit enter, and I'm indented on the 8th position, 
with all spaces.
The last behaviour suggest to me that the autocompletion of the close-} is 
somehow throwing off the spaces for tab indentation and placement of the cursor.
Comment 1 Dani Megert CLA 2004-11-10 05:21:49 EST
There are two things here:
1) if you simple press Tab then space will be inserted as you've chosen
2) if you use more complex features the formatter settings are used which you
probably didn't adjust and hence you get Tabs and Spaces.

This problem is covered in bug 19036.


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