I started out coding using the Allman style, with aligned braces:
void foobar()
{
if(foo)
{
bar();
}
}
After decades I've decided I want that extra screen space; and besides, my client uses non-matched braces, so it's hard to switch back and forth from work to my personal code. So I want to convert all my existing code to K&R:
void foobar() {
if(foo) {
bar();
}
}
Eclipse 4.4 has a sufficient code formatter, and if I select my source tree I can even format files in bulk. The problem is that if I have a line comment where a K&R brace would be, Eclipse will refuse to move the brace up a line, leaving me with a hodgepodge of coding styles:
void foobar() {
if(foo) //if foo
{
bar();
}
}
How can I tell Eclipse to move the brace up, even if there is a comment on the line where the brace goes?
void foobar() {
if(foo) { //if foo
bar();
}
}