Bug 28988 - [typing] Option for real or phantom indentation
Summary: [typing] Option for real or phantom indentation
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-03 16:31 EST by Brian Pontarelli CLA
Modified: 2005-04-06 10:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;*
}