Hello IntelliJ,

I proposed from time to time, that IDEA should have an option for smart 
tab-placements. What do you think about it?

For all, that can't remember, what I meant, I 'll explain in short. Assume 
following code:

     private int test(String value1,
                      String value2) {
         return getValue(value1,
                         value2);
     }

I want to get following use of spaces and tabs (tabs are marked as "|->" 
and spaces as "." where important; 4 spaces per tab):

|-->private int test(String value1,
|-->.................String value2) {
|-->|-->return getValue(value1,
|-->|-->................value2);
|-->}

and now, viewed with 8 spaces per tab:

|------>private int test(String value1,
|------>.................String value2) {
|------>|------>return getValue(value1,
|------>|------>................value2);
|------>}

Advantages: everything, that is in one column, remains in one column. You 
can view this code with any spaces-per-tab-settings you prefer, it always 
looks good.

To get this, only some rules are necessary:

1) Each non-wrapped line is indented with tabs.
2) Each wrapped line takes the tab-indentation from the last non-wrapped 
one and fills the rest with spaces!
3) Tabs are only valid before the left non-white-space character. Pressing 
the tab key, lets say after "getValue(value1,|" always inserts spaces, 
never tabs!

I hope, that IDEA would have this smart indentation engine. I believe, it 
even would help SUN to layout their sources (having a look into the 
Jdk-Sources with a tab setting different than 8 is terrible).

Tom


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to