I've long been a "align curly braces" person. And with wide monitors I put long comments after code. So in Eclipse I want to do format things like this:
if(foo)
{
something();
}
else
{
somethingElse();
}
Fine; that's easy. But then I add a comment:
if(foo) //if foo is true
{
something();
}
else //if no foo
{
somethingElse();
}
Dratted Eclipse formats it like this:
if(foo) //if foo is true
{
something();
}
else
//if no foo
{
somethingElse();
}
Great. That whole wasted line. And it looks ugly. And it's not even precise, because I want to comment the else line.
How can I get Eclipse to format my if/else with aligned braces, but allow my comments to be on the same line as else?
This was tested on Eclipse 4.2.2, and I have just confirmed that it does not work in Eclipse 4.3M7, either.
I have filed a bug on the issue; let's see what the Eclipse developers have to say.