Menu

#306 Single-line/multi-line bracket switching

open
nobody
5
2006-08-07
2006-08-07
Dan Smith
No

I spend far too much of my editing time doing mundane formatting. In
the absense of a full-fledged automatic line-wrapping facility (as has
been suggested previously), it would be nice if there were just a quick way
to turn this:

public void myMethod() { doSomething(); }

into this:

public void myMethod() {
doSomething();
}

and vice-versa.

This follows in the spirit of auto-indenting: I've provided the text, and I
want the computer to adjust the white space for me. A keyboard shortcut
when the cursor is within the relevant brackets -- as easy as hitting "tab"
on a line -- would be ideal.

It may be that this problem is unique to my coding style. I make it a habit
to always use brackets where they are optional (such as after an "if"), and
to always put a bracketed statement on a single line if it will fit. It's worth
discussing whether this style is adhered to generally enough to make this
feature addition worthwhile.

Discussion