I work with a lot of code which has 'dropped' braces, such as
if () { } else { }
I personally prefer the K&R style, such as
if () { } else { }
I made this new macro to make conversions easier - it simply keeps a space before/after the brace when joining lines - otherwise joining the lines would result in
if (){ }else{ }
I added it as a second macro with a scope of just "source", so text files won't be affected.
Thoughts?
Cheers, Ciarán
On 17. Oct 2006, at 12:41, Ciarán Walsh wrote:
[...] I added it as a second macro with a scope of just "source", so text files won't be affected.
Thoughts?
This is brilliant! For me I always want space after comma, and frequently put it there myself after a Join Line.
This is brilliant! For me I always want space after comma, and frequently put it there myself after a Join Line.
I've reworked it a bit to fix a couple of small bugs and to add some more characters. Now the following sets will have a space added after a join line: && || , : ; { ) and an opening brace gets a space before it. So a few joins will change this:
if (true && test(1, 0) || foo ) { // Code } else { // Code }
Into this:
if (true && test(1, 0) || foo) { // Code } else { // Code }