Bug 28988

Summary: [typing] Option for real or phantom indentation
Product: [Eclipse Project] JDT Reporter: Brian Pontarelli <brian>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: bogofilter+eclipse.org, nikolaymetchev
Version: 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Brian Pontarelli CLA 2003-01-03 16:31:59 EST
The current version of the JDT always inserts the current indent when the 
return key is pressed. It would be nice to have an option to that would allow 
this to be changed so that a phantom indent would be used. A phantom indent 
places the cursor to the current indent level, but does not insert the indent 
characters until the user starts typing. If the user hits return again, the 
first empty line would then be empty rather than containing spaces or tabs to 
the current indent level. 

Here are examples of phantom and real indents. I assume that the user has 
selected spaces for indentation and I will represent spaces with the '.' 
character and the cursors position with the '*' character. Like my other bugs 
and enhancements I'll use before and after. The before is the buffer right 
before the user hits return. After is directly after they hit it.

Real indent
-----------
before->
myMethod() {*
}

after->
myMethod() {
....*
}

after 2->
myMethod() {
....
....*
}


Phantom indent
before->
myMethod() {*
}

after->
myMethod() {
    *
}

after 2->
myMethod() {

    *
}

after 3->
myMethod() {

....userTypedThis;*
}