Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#277 Indentation offset of function arguments

open
nobody
None
5
2015-01-03
2014-04-16
xrr
No

Hi,

Say we have this code:

..return function(
....longLongLongLongargument1,
....longlonglonglongargument2,
....longlonglonglongargument3);

astyle changes the indentation to:

..return function(
...........longLongLongLongargument1,
...........longlonglonglongargument2,
...........longlonglonglongargument3);

Might be just me, but I prefer the initial indentation. Couldn't find an option for such indentation, it would be nice to have.

Thanks.

Discussion

  • Adelost
    Adelost
    2014-06-16

    I concur. I also would like the option to keep the original single indented break, as it sometimes allows more compact code, as in #2 bellow.

    // #1 Parenthesis aligned break (ASync default)
    ratherLongFunction(true,
                       "Long text, perhaps a log message of some kind.");
    
    // #2 Indented break
    ratherLongFunction(true,
        "Long text, perhaps a log message of some kind.");
    
     
    Last edit: Adelost 2014-06-16
  • I wouldn't mind this option myself. I like to keep the code lines short and I often use multiline routine calls for that:

    createGroup(
        "gof",          // name
        "Gang of Four", // description
        false,          // sharedResources
        false);         // public
    

    With many (more than 3) parameters it also gives the option of using comments to explain each of them. Currently I indent everything with four spaces, no exceptions.