Edwin Delsman wrote:
>I'm trying out IntelliJ and I've become very enthousiastic about it's merits
>in a very short time. However, there are some small inconveniences with
>auto-blocks when editing the following existing code (though you won't hear
>me arguing to turn the feature off!):
>
> if (condition)
> foo();
>
>If I want to add some extra statements in the if clause, I open a block
>behind the if. IntelliJ than produces this (effectively removing the foo()
>from the controlled statement!):
>
> if (condition) {
> |
> }
> foo(); // foo placed outside the block: not as intended
>
This annoys me too, but on the other hand marking foo(); and surrounding
(ctrl-alt-t) with braces works. I'll have to see if I can get used to
doing it that way instead.
>It would be nice to have intelliJ keep the foo() inside the block. The same
>applies to other places, such as after an else clause. A similar thing
>happens when editing:
>
> if (condition) {
> foo1();
> foo2();
> }
>
>When I need to add a statement before foo1() I'm accustomed to position the
>caret atfer the if () { and press Enter there. However, I then get a similar
>problem:
>
> if (condition) {
> |
> }
> foo1(); // code placed outside the block: not as intended
> foo2();
> } // unmatched closing brace
>
>It would be nice if IntelliJ could detect that the block is already closed
>and omits inserting the closing brace.
>
+1! Even though you could place the cursor at the beginning of the
foo1() line and press enter, this is not a good workaround since then
you have to move the cursor up to the previous line again and manually
press TAB a number of times to get the right indentation.
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list