Community
Participate
Working Groups
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;* }