code8825 / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Auto-format should differentiate array initializer braces from code block braces {} #939

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What change would like to see?

Currently, auto-format turns:

int foo[] = { 1, 2, 3, 4, 5};

into:

int foo[] = { 
1, 2, 3, 4, 5};   

Because it treats all left / opening curly braces { as the start of a code 
block.

Instead, we should see if the brace is right after an equals sign and, if so, 
not insert a newline after it.  Or, actually, we should probably just check if 
the matching closing brace is on the same line as the opening brace (in which 
case, the user probably wants it that way and we should leave it alone).  That 
would apply to code to, for example:

for (int i = 0; i < 5; i++) { Serial.println(i); }

or:

void loop() {}

Original issue reported on code.google.com by dmel...@gmail.com on 1 Jun 2012 at 3:06

GoogleCodeExporter commented 9 years ago
Now fixed. See https://github.com/arduino/Arduino/issues/939

Original comment by f.fiss...@arduino.cc on 15 Oct 2013 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by c.mag...@arduino.cc on 15 Oct 2013 at 8:14