Russ,
I see your point. Distinguishing between an old and a new if() would be
rather difficult. Maybe the desision could be based on the indentation of
the next line.
However, such a wild guess might produce rather unpredicatable results,
which may be worse than the original problem. If it isn't feasible to
properly detect that the statement did in fact belong to the if() it may be
best to keep it this way and try to learn using surround with.
It does However requires more work and more awareness: I tend to put the
caret after if and THEN decide if I need a brace. Just pressing down and
surround with doesn't always do the trick properly if the next statement is
e.g. a while loop.
Maybe that would even be the better change: if surround with was smarter
about auto-selecting a statement when there is no selection set: e.g.
auto-select the current line as it does now, and if that is not a full
statement do something like Ctrl-W to expand to a full statement. Hell, I
might even be able to learn to do that little trick myself! ;-)
(sorry about the bad language).
The second case I mentioned (with pressing enter after '{' in an already
closed block) is indeed fixed already. Matched braces are not broken. Sorry
I didn't check again before I mailed.
> This sounds neat, but it's tricky. What if I have an existing line:
>
> a = 10;
>
> ...and I want to add a brand new if statement in front of it, but I don't
want
> this assignment in the braces. I'm just adding an entirely new if
statement:
>
> if(true) {
> blah = "blah"
> }
> a = 10;
>
> While I'm typing "if(true) {", you would not be able to distinguish
between
> a line which I wanted to be in the condition block or not in the condition
> block, unless you based it on how long the if statement was there (an old
> if statement encloses the next line in braces, a brand new if statement
doesn't).
>
> > 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
Edwin Delsman
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list