Breaking Long Lines

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 6 08:11:40 UTC 2020


Hello,

for breaking long lines we have currently:

"Should be replaced with

.. code-block:: c

   for (
     initialization = statement;
     a + really + longish + statement + that + evaluates + to <
     a + boolean;
     another + statement++
   ) {
     z = a + really + longish + statement + that + needs +
         two + lines + gets + indented + four + more +
         spaces + on + the + second + and + subsequent +
         lines + and + broken + up + at + operators;
   }

Note that indentations should add 2 nesting levels (4 space characters, 
not tabs)."

Do we really need two indent levels for breaking long lines in block 
statements? I would just say that the continuation of a broken line is 
indented by one level. The example would look like this (please note the 
change in the for loop "a + boolean"):

.. code-block:: c

   for (
     initialization = statement;
     a + really + longish + statement + that + evaluates + to <
       a + boolean;
     another + statement++
   ) {
     z = a + really + longish + statement + that + needs +
       two + lines + gets + indented + four + more +
       spaces + on + the + second + and + subsequent +
       lines + and + broken + up + at + operators;
   }

-- 
embedded brains GmbH
Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
Phone: +49-89-18 94 741 - 16
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

embedded brains GmbH
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list